Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I only have 1 IP address, but I would like to host 2 websites: and on the same IP.

So I was wondering if there is a router/firewall feature that let's me do that?

share|improve this question
No, NAT works on OSI Model Layer 4; HTTP is up on Layer 7. There are other ways to achieve this however. – Chris S Jul 8 '10 at 12:37
up vote 3 down vote accepted

You have a few options. You could use virtual hosts to host both domains on the same server/IP address. Or you can setup a reverse proxy to handle redirecting the requests to the correct private IP address in your DMZ. Examples of reverse proxies are Varnish, nginx, squid, and or even Apache with mod_proxy.

share|improve this answer
+1, Also ISA Server/Forefront TMG does this as well. – Chris S Jul 8 '10 at 12:38

You can do this with named based virtual hosting on the web server itself or by using a reverse proxy between the router and your web server.

These both work by parsing how the HOST field of the http header and directing the request accordingly. I have never seen a firewall or router that does this to redirect traffic (although it doesn't mean some can't of course).

You should mentioned what type of router and firewalls you have as well as the OS and program of your web service.

share|improve this answer
man you're too quick :) – 3dinfluence Jul 8 '10 at 12:33

You don't need router support for that, the webserver can do that just fine. For Apache, this is called Virtual Host.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.