1 ip - 2 webservers Possible?



  • 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!



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


  • Netgate

    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.



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



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



  • @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!



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