HAProxy community

Domain Proxy : Frontend and backend using different domains


I have a web application running as - www.site-a.com/dash
My customer wants to run it as - www.site-b.com/dash
frontend and backend are SSL

There are some 301 redirects in the web application.
My requirement is that customer should be able to use the web app as www.site-a.com/dash.

Frontend should be as site-a.
backend should be as site-b.

How can I achieve this in haproxy ?


Configure the application on your server correctly, so that it knows the correct domain.

You can rewrite host headers, SNI values, etc. But then you are still missing cookies domain names, Location redirects, etc. It’s not worth the trouble, just configure your application correctly.

Okay noted.
Still is it possible to rewrite “Location” header in haproxy ? Just out of curiosity.


You can rewrite every header, yes. But covering everything is complex and error prone.