# Haproxy reverse proxy, headers, 2 domains

**URL:** <https://discourse.haproxy.org/t/haproxy-reverse-proxy-headers-2-domains/11558>\
**Category:** Help!\
**Created:** [January 23, 2025, 10:52am UTC](https://discourse.haproxy.org/t/haproxy-reverse-proxy-headers-2-domains/11558 "2025-01-23T10:52:44Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![bald](https://avatars.discourse-cdn.com/v4/letter/b/6bbea6/32.png) [@bald](https://discourse.haproxy.org/u/bald)\
**Post date:** [January 23, 2025, 10:52am UTC](https://discourse.haproxy.org/t/haproxy-reverse-proxy-headers-2-domains/11558/1 "2025-01-23T10:52:44Z")

</div>

Greeting,

can someone please help with my issue.

I have an [example.com](http://example.com) domain that listens on an IP address and I have a CNAME [example2.com](http://example2.com) on the same IP address.

when the user comes from the url [example2.com](http://example2.com), it preservs the url, but none of the links on the page still work, the page is empty only when it comes from [example2.com](http://example2.com)

configuration:

frontend [example.com](http://example.com)  
bind \*:443 ssl crt /etc/haproxy/certs/ no-sslv3 no-tls-tickets  
bind \*:80  
mode http  
acl example2\_com hdr(host) -i [example2.com](http://example2.com)  
default\_backend [example.com](http://example.com)  
http-after-response set-header Strict-Transport-Security “max-age=31536000; includeSubDomains”  
http-request redirect scheme https unless { ssl\_fc }  
http-request set-header X-Forwarded-Proto https  
http-request set-header FRONT\_END\_HTTPS on  
use\_backend example2\_com if example2\_com

backend example2\_com  
http-request set-header Host [example.com](http://example.com)  
server [example.com](http://example.com) ip:port

backend example\_com  
server [example.com](http://example.com) ip:port

---

<div class="post-metadata">

**Author:** ![IgorC](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.haproxy.org/igorc/32/161_2.png) [@IgorC](https://discourse.haproxy.org/u/IgorC)\
**Post date:** [January 27, 2025, 11:05pm UTC](https://discourse.haproxy.org/t/haproxy-reverse-proxy-headers-2-domains/11558/2 "2025-01-27T23:05:07Z")

</div>

Open your browser development console and you will see what your problem is based on the errors you see there. Probably cross origin related nothing to do with haproxy.
