Quantcast
Channel: HAProxy community - Latest topics
Viewing all articles
Browse latest Browse all 4849

Trying to rewrite www tot non www HAproxy 3

$
0
0

Hi,

I used to run HAProxy 1.9 and recently updated to 3.0.8 but I can’t get redirection from www.domain.com to domain.com, which was working on 1.9.

My config on HAproxy 3 looks as follows:

frontend http-https
bind *:80
bind *:443 ssl crt-list /etc/haproxy/certs/certificate-list.txt strict-sni
http-request return status 200 content-type text/plain lf-string “%[path,field(-1,/)].${ACCOUNT_THUMBPRINT}\n” if { path_beg ‘/.well-known/acme-challenge/’ }
mode http

http-request redirect scheme https code 301 if !{ ssl_fc }

acl vdsverhuur_acl hdr(host) -i vdsverhuur.be
use_backend vdsverhuur if vdsverhuur_acl

acl www-vdsverhuur_acl hdr(host) -i www.vdsverhuur.be
use_backend vdsverhuur if www-vdsverhuur_acl

backend vdsverhuur
mode http
#balance roundrobin
server verzamel01 172.16.0.12:80 check
option forwardfor
http-request set-header X-Forwarded-Port %[dst_port]
http-request add-header X-Forwarded-Proto https if { ssl_fc }

I have been Googling fo 2 days now but I can’t find anything that works. Yny ideas to put me in the right direction?

Thanks,
Rene

6 posts - 2 participants

Read full topic


Viewing all articles
Browse latest Browse all 4849

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>