Netgate Discussion Forum
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Search
    • Register
    • Login

    HAProxy with Virtual Hosts on backend

    Scheduled Pinned Locked Moved Cache/Proxy
    2 Posts 2 Posters 1.4k Views
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • P
      papdee
      last edited by

      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.50

      from 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 80

      www.website1.com is OK
      www.website2.com error connection timeout

      1 Reply Last reply Reply Quote 0
      • P
        pppd
        last edited by

        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

        1 Reply Last reply Reply Quote 0
        • First post
          Last post
        Copyright 2025 Rubicon Communications LLC (Netgate). All rights reserved.