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

    Haproxy -> 1:1 mapping domain to server

    Scheduled Pinned Locked Moved pfSense Packages
    3 Posts 2 Posters 2.8k 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
      p0ker
      last edited by

      Trying to work out simple task (I think).

      I've tried searching the forum and the world wide web… and as fare as I can find, haproxy will solve all my problems.
      But I can't seem to get it to work the way I want. As I understand haproxy is mostly used for load balancing, but can also work for my setup.

      Basically I have only one WAN ip, with two different web server (at the moment).
      I'm also hosting a couple of domains, and I want them to go to different server.

      foo.domain1.com --> local_webserver1
      bar.domain2.com --> local_webserver1

      domain3.com --> local_webserver2
      domain4.com --> local_webserver2

      Why I want this, is because I run one bsd apache server, and one win2k8 IIS server.

      There are a lot of reference's to this kind of setup, even on this forum. But everyone just points in the direction of haproxy, not how you would go about setting this up.

      From the gui, I have no idea how to set this up.
      I've found some information [1], [2], witch explain how to do get it up and working…
      But when I do a manual edit of the haproxy.cfg file, restart the haproxy service the old config pops up again.. :(

      [1] - http://jit.nuance9.com/2009/11/haproxy-routing-by-domain-name.html
      [2] - http://nixcraft.com/high-availability-cluster/15957-multiple-domain-subdomain-routing-haproxy-2.html

      Anyone care to explain what I need to do?

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

        Guess I found my self answering my own question.
        Well, not entirely… Found another packaged mod_security witch did exactly what I wanted to do.

        Just remember to switch pfsense gui from http to https, otherwise mod_security will brake your setup when installed! :)

        1 Reply Last reply Reply Quote 0
        • Y
          YG78
          last edited by

          I'd love to know how you made it work.

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