HAProxy with Virtual Hosts on backend
-
Just need to confirm if HAProxy works with virtual hosts on the backend. Having some difficulty getting past the default website but just need to confirm my setup is the problem and not HAProxy.
Apache is setup to listen on 0.0.0.0:80
Virtual hosts:
- ServerAlias website1.local (default)
- ServerAlias website2.local
PfSense DNS resolver host override entries:
website1.local = 10.0.0.50
website2.local = 10.0.0.50from pfsense box go to shell:
curl http://website1.local returns <html>this is website1</html>
curl http://website2.local returns <html>this is website2</html>HAProxy config:
frontend -> ACL host matches www.website1.com -> use backend -> website1.local port 80
frontend -> ACL host matches www.website2.com -> use backend -> website2.local port 80www.website1.com is OK
www.website2.com error connection timeout -
Nevermind this. I just found a post that I needed to do a http request set headers in the backend section.
https://forum.netgate.com/topic/147131/how-do-i-set-headers