I am a web programmer with a home web dev operation. I have multiple web servers in my house on a FIOS connection. I have my own domain pointed to my router through dyndns.org's custom domain service.
My ISP gives me ONE static IP address, which at the moment allows me to configure my router to direct outbound web traffic from one server through port 80 and another server through port 8080. This sucks because many companies block port 8080 these days causing some of my corporate clients to not be able to hit my second web server.
Is there any way for me to direct regular old port 80 web traffic to TWO SEPARATE web servers internally on my network using two separate host names?
For instance. I want http://webserver1.mydomain.com
to hit one web server on my network, and http://webserver2.mydomain.com
to hit another web server and have both sets of traffic served on port 80.
Is this even possible? If not, can I do a hack by programmatically routing traffic from one web server transparently to another?
For the record I run MS Windows Server 2008 IIS 7.0 stack, a D-link DIR-655 router, and use DynDNS for my domain needs.
Answer: Yes. Two virtual servers on the same Application Switch or Web Switch can share the same virtual IP address as long as they are each configured with unique services or with different source networks.
So what's going on? For a system to communicate via a network, it must have a unique IP address. Conflicts arise when two devices are on the same network trying to use the same IP address. When this occurs, both computers cannot connect to network resources or perform other network operations.
Sometimes people run dns servers on the same machine as their web server. In this case, you need two ip addresses for two different name servers in order to comply with RFCs.
You can run two different servers on the same localhost via different port numbers or two different localhosts on the same port (localhost ranges 127.0. 0.0 - 127.255.
The name of the solution you looking for is called reverse proxy'ing.
There are implementations in apache, squid and Mircosoft ISA Server.
If your adventurous you can always roll your own? or modify something like this to meet your your needs.
I've had customers using squid reverse proxy that's high volume and it works perfectly!
It does tend to screw up your web logs on the webserver though, traffic will all appear to come from your internal proxy host that's doing the redirection/rewriting.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With