views:

632

answers:

5

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.

+2  A: 

Yes, use IIS7's Rewrite module to do this

Paul Betts
+1  A: 

Some sort of application layer routing could be your option. This article points to how to do it on ISA server (using web rules)

http://www.codinghorror.com/blog/archives/000984.html

Midhat
+1  A: 

You might be able to set up apache with 2 vhosts, and then in each of their blocks put a proxy of the appropriate site on your local network:

In vhost 1:

ProxyRequests Off

<Proxy *>
Order deny,allow
Allow from all
</Proxy>

ProxyPass / http://192.168.0.49/
ProxyPassReverse / http://192.168.0.49/

In vhost 2:

ProxyRequests Off

<Proxy *>
Order deny,allow
Allow from all
</Proxy>

ProxyPass / http://192.168.0.50/
ProxyPassReverse / http://192.168.0.50/

You'd need mod_proxy, and I'm not even sure this would work

FryGuy
+7  A: 

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.

Nick Kavadias
+1 for ISA Server. I know Matias IRL and he'd be all about it.
Chris
A: 

Why not keep it simple and just order or request a second IP address on your account? This seems to be a much easier solution than a convoluted hardware and/or software setup. Just don't tell them you're hosting websites because ISPs generally don't like people to do that on residential accounts (I'm actually surprised they don't block port 80).

Marc Novakowski
The do block port 80 on res accounts. This is a business acct.
Matias Nino