OPNsense Forum

Archive => 17.7 Legacy Series => Topic started by: mvdheuvel on December 30, 2017, 10:05:30 am

Title: HAProxy Reverse Proxy with subdomains
Post by: mvdheuvel on December 30, 2017, 10:05:30 am
Hi,

I am struggling a while with HAProxy plugin.
I have a single IP address and a single domain name.
I have a VMware server with multiple webservers.
I want to configure reverse proxy, so that I can use my single domain name with multiple domain.

Example.

support.example.com --> server1
www.example.com --> server2
transfer.example.com --> server3
nextcloud.example.com --> server4

(internet address) --> opnSense --> webserverX (VMware)

I am not able to find the right answers in all the fora.
Can someone help me with this question if it is possible with opnSense, I starting to think opnSense is not the right solution for this environment.
Title: Re: HAProxy Reverse Proxy with subdomains
Post by: fabian on December 30, 2017, 12:50:41 pm
https://docs.opnsense.org/manual/how-tos/haproxy.html
Title: Re: HAProxy Reverse Proxy with subdomains
Post by: mvdheuvel on December 30, 2017, 03:47:16 pm
I have followed that guide, but no luck with it.
It will always resolve to the latest made frontend.
Title: Re: HAProxy Reverse Proxy with subdomains
Post by: fabian on December 30, 2017, 03:52:16 pm
Then probably something went wrong in Step 4 - it connects your hostname to a backend server.
Title: Re: HAProxy Reverse Proxy with subdomains
Post by: mvdheuvel on December 30, 2017, 05:28:15 pm
Thanks,

The trick is that you use only 1 frontend server and add the rules for the different domains to this frontend.