Forward differing hostnames to different internal IPs through NAT router

I have one public IP address, one router and multiple servers behind the router.

I would like to forward differing domains (All using HTTP) through the router to different servers.

For example:

example1.com      =>  192.168.0.110
example2.com      =>  192.168.0.120
foo.example2.com  =>  192.168.0.130
bar.example2.com  =>  192.168.0.140

I understand that this could be accomplished using Port Forwarding, but I need all hosts running on port 80.

I found some information about IP Masquerading, but I found this difficult to understand, and I am not sure if it is what I am after.

Another solution I have found is to direct all traffic to Reverse Proxy server, which forwards the requests onto the appropriate server. What about iptables?

I am using a Billion 7404 VNPX router. Is there a feature that this router has that can accomplish this?

Are these my only options? Have I missed something completely? Is one recommended over the others?

I have searched around but I don't think I am hitting the correct keywords.


Solution 1:

The best solution would be to user a HTTP reverse proxy. For this you can use:

  • apache with mod_proxy
  • pound
  • squid
  • nginx

We are using apache with mod_proxy, but I am thinking to go with pound.

As a hardware appliance you can use a Cisco Content Service Switch. See: http://www.cisco.com/en/US/products/hw/contnetw/ps792/index.html