i configure haproxy, when i type test.example.com it redirect me to example.com/test
This is what i want but the problem i want this happen without changing the url on the browser, i want it to keep test.example.com but send request to example.com/test
Here is my haproxy.cfg
**frontend tt bind *:80 bind *:443 mode http default_backend ss bind :443 ssl crt /etc/ssl/certs/ssl.pem
http-request redirect scheme https unless { ssl_fc }
backend ss mode http balance roundrobin option forwardfor
http-request set-header X-Forwarded-Port %[dst_port] http-request add-header X-Forwarded-Proto https if { ssl_fc } http-request set-var(req.rewrite_example) req.hdr(host),lower,regsub(.example.com$,) if { hdr_end(host) -i .example.com } http-request set-path /%[var(req.rewrite_example)] if { var(req.rewrite_example) -m found }
http-request set-header Host example.com if { var(req.rewrite_example) -m found } option httpchk HEAD / HTTP/1.1rnHost:localhost
server web1 example.com:80
**