Hi all,
I'm trying to replace the nginx setup with the haprixy which seems to be
more suitable for our purposes.
In our setup there are several development servers hidden behind the HA
PROXY. The development dserver are the copy of the template. On the NGINX
I'm doit Host header rewrite
<client> ---> www04.devel.domain.com ---> nginx ----> www.devel.domain.com
-----> www04.dev.(server)
Each of the devel server is able to handle domain www.devel.domain.com,
the nginx is rewtiting the
Nginx configuration looks like /only relevant parts .../
server {
server_name www04.devel.domain.com;
proxy_redirect off;
proxy_set_header Host www.devel.domain.com;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
location / {
proxy_pass http://backend_domain_www_servers_devel04;
proxy_redirect http://www.devel.domain.com/ https://$host/;
}
}
For HAPROXY I tried this
backend devel-web04
reqrep ^Host: Host:\ www.devel.domain.com
rspirep ^(.*)www.devel.domain.com(.*) \1www04.devel.domain.com\2
server web04.dev 192.168.30.79:80 maxconn 32
The problem is, that only the first request si rewritten from
www04.devel.domain.com to www.devel.domain.com. All subsequent request did
not pass the rewrite rule.
Please could some figure me out, where is the problem?
Best regards
Peter Hudec