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 have a single static IP and I would like to run multiple web servers (and multiple sites) on my network through it. There are multiple domains that I have pointed at the IP but I don't know where to start to get the traffic distributed to the right servers. What do I need to do?


EDIT: to clarify, by multiple web servers I was referring to multiple "boxes" not just multiple sites. sorry for the confusion.

share|improve this question
sorry about that. I am flexible on the technology but currently there are multiple boxes. two running apache and two running nginx. all on ubuntu. – chrishomer Feb 26 '12 at 1:44
up vote 4 down vote accepted

If I understand correct, you want to pass the traffic to the domain specific server in your network.

To do so, I suggest you use a reverse proxy which passes incoming request to the backends. Without knowing more details, I usually recommend nginx oder apache if you prefer.

If you use nginx listening on your public IP, you could use something like this in your nginx.conf:

server{ location / { proxy_pass http://backend1; } }

server{ location / { proxy_pass http://backend2; } }

share|improve this answer

You should probably clarify what web server you're using but I'll assume Apache. If so, look into vhost files. What you want to do is very common and quite easy.

share|improve this answer
vhosts are fine for a single box. but there are multiple boxes. – chrishomer Feb 26 '12 at 1:44

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.