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

    Routing to 2 web servers, 1 wan

    Scheduled Pinned Locked Moved General pfSense Questions
    5 Posts 4 Posters 515 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.
    • N
      Nimda100
      last edited by Nimda100

      Hi everyone,

      I have an unusual request or at least I cant find any similar threads.

      I have a simple Pfsense on a box, with 1 WAN and 1 LAN

      I have 2 domains, ill call them domain1.com and domain2.com and a webserver for each domain on the LAN called websrv.domain1.com and websrv.domain2.com

      Each domain has an A record for each server pointing to our WAN IP (the requests reach our WAN with no problem)

      I would like to know if I can route HTTP (port80) traffic from each of those domains to the respective web servers on the LAN?

      if anyone has any suggestions how to accomplish this I would be very appreciative.

      TIA

      Paul

      JKnottJ 1 Reply Last reply Reply Quote 0
      • RicoR
        Rico LAYER 8 Rebel Alliance
        last edited by

        Check out the HAProxy package.

        -Rico

        1 Reply Last reply Reply Quote 0
        • JKnottJ
          JKnott @Nimda100
          last edited by

          @nimda100

          There is a method where the HTTP(S) header is examined for the requested host name. With this, you can have multiple servers at the same IP address and then sort out the connections accordingly. However, I haven't done this myself, so I'm no expert.

          PfSense running on Qotom mini PC
          i5 CPU, 4 GB memory, 32 GB SSD & 4 Intel Gb Ethernet ports.
          UniFi AC-Lite access point

          I haven't lost my mind. It's around here...somewhere...

          1 Reply Last reply Reply Quote 0
          • stephenw10S
            stephenw10 Netgate Administrator
            last edited by

            Yup you can do it using host headers either in HAProxy or Squid Reverse.

            Steve

            1 Reply Last reply Reply Quote 0
            • RicoR
              Rico LAYER 8 Rebel Alliance
              last edited by

              Oh and by the way, @jimp did a great hangout: https://www.netgate.com/resources/videos/server-load-balancing-on-pfsense-24.html :-)

              -Rico

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