Forward differing hostnames to different internal IPs through NAT router

Posted by abrereton on Server Fault See other posts from Server Fault or by abrereton
Published on 2010-12-22T00:29:11Z Indexed on 2010/12/22 0:56 UTC
Read the original article Hit count: 541

Hi,

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.

Thanks in advance.

© Server Fault or respective owner

Related posts about iptables

Related posts about routing