3

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?

Thanks.

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

1
  • 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
4

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 mydomain.com{ location / { proxy_pass http://backend1; } }

server myotherdomain.com{ location / { proxy_pass http://backend2; } }

2

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.

http://httpd.apache.org/docs/2.0/vhosts/examples.html

1
  • vhosts are fine for a single box. but there are multiple boxes.
    – chrishomer
    Feb 26 '12 at 1:44

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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