# Domain Proxy : Frontend and backend using different domains

**URL:** <https://discourse.haproxy.org/t/domain-proxy-frontend-and-backend-using-different-domains/4399>\
**Category:** Help!\
**Created:** [October 17, 2019, 9:47am UTC](https://discourse.haproxy.org/t/domain-proxy-frontend-and-backend-using-different-domains/4399 "2019-10-17T09:47:40Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![fatalkill3r](https://avatars.discourse-cdn.com/v4/letter/f/d78d45/32.png) [@fatalkill3r](https://discourse.haproxy.org/u/fatalkill3r)\
**Post date:** [October 17, 2019, 9:47am UTC](https://discourse.haproxy.org/t/domain-proxy-frontend-and-backend-using-different-domains/4399/1 "2019-10-17T09:47:40Z")

</div>

Hi

I have a web application running as - [www.site-a.com/dash](http://www.site-a.com/dash)  
My customer wants to run it as - [www.site-b.com/dash](http://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](http://www.site-a.com/dash).

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

How can I achieve this in haproxy ?

Thanks

---

<div class="post-metadata">

**Author:** ![lukastribus](https://avatars.discourse-cdn.com/v4/letter/l/7ea924/32.png) [@lukastribus](https://discourse.haproxy.org/u/lukastribus)\
**Post date:** [October 17, 2019, 3:07pm UTC](https://discourse.haproxy.org/t/domain-proxy-frontend-and-backend-using-different-domains/4399/2 "2019-10-17T15:07:16Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![fatalkill3r](https://avatars.discourse-cdn.com/v4/letter/f/d78d45/32.png) [@fatalkill3r](https://discourse.haproxy.org/u/fatalkill3r)\
**Post date:** [October 18, 2019, 5:09am UTC](https://discourse.haproxy.org/t/domain-proxy-frontend-and-backend-using-different-domains/4399/3 "2019-10-18T05:09:22Z")

</div>

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

Thanks

---

<div class="post-metadata">

**Author:** ![lukastribus](https://avatars.discourse-cdn.com/v4/letter/l/7ea924/32.png) [@lukastribus](https://discourse.haproxy.org/u/lukastribus)\
**Post date:** [October 18, 2019, 7:24am UTC](https://discourse.haproxy.org/t/domain-proxy-frontend-and-backend-using-different-domains/4399/4 "2019-10-18T07:24:45Z")

</div>

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