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

    1 ip - 2 webservers Possible?

    Scheduled Pinned Locked Moved NAT
    7 Posts 4 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.
    • O
      ocpistol
      last edited by

      So excuse my ignorance but I only have 5 ip addresses so I was wondering if it is possible to set 2 separate web servers using port 80 to use the same external IP. Is there someway to setup what domains get pointed were?

      Thank You!

      1 Reply Last reply Reply Quote 0
      • KOMK
        KOM
        last edited by

        I've never done it myself, but it looks like the Reverse Proxy functionality of Squid3 may be able to do that.  It seems to allow you to specify your web servers as peers and which port they listen on, and then you specify URLs that will be directed to each peer.

        1 Reply Last reply Reply Quote 0
        • DerelictD
          Derelict LAYER 8 Netgate
          last edited by

          You would need a proxy that understands http/1.1 and forwards the request to the correct host.

          But as far as pfSense doing it with a port forward, no.

          Chattanooga, Tennessee, USA
          A comprehensive network diagram is worth 10,000 words and 15 conference calls.
          DO NOT set a source address/port in a port forward or firewall rule unless you KNOW you need it!
          Do Not Chat For Help! NO_WAN_EGRESS(TM)

          1 Reply Last reply Reply Quote 0
          • K
            kroberts
            last edited by

            You don't need any proxy other than a web server and a dns server.

            Define both (or 50) domain names to point at your external address. Your router redirects port 80 to your full featured web server like apache2. Apache needs a pretty simple config for each site which can be hosted by that apache instance, a different web server on the same box or another web server on a different box.

            Each web server actually running on each box needs a unique port but your master server only needs port 80 or 443 depending on protocol.

            Search on name based virtual hosts for apache2. The documentation for apache2 is very good and there are thousands of good examples of this exact scenario.

            1 Reply Last reply Reply Quote 0
            • K
              kroberts
              last edited by

              Sorry there's more to say and I'm doing this from my phone.

              Http embeds the url in the request. This is not magic, http is designed around the idea of lots of servers from one IP address, or lots of internal servers from a single public address.

              Apache runs on every platform you might use and has pretty straightforward configuration for just about any scenario you can dream up.

              1 Reply Last reply Reply Quote 0
              • O
                ocpistol
                last edited by

                @kroberts:

                Sorry there's more to say and I'm doing this from my phone.

                Http embeds the url in the request. This is not magic, http is designed around the idea of lots of servers from one IP address, or lots of internal servers from a single public address.

                Apache runs on every platform you might use and has pretty straightforward configuration for just about any scenario you can dream up.

                Thanks ill Look into setting that up! thank you!

                1 Reply Last reply Reply Quote 0
                • K
                  kroberts
                  last edited by

                  If you're limited on external ip addresses then just nat the web server. Http has to be the most accommodating protocol ever.

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