Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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.

share|improve this question
    
You question is missing a few details. OS/Web server type. Also, you may want to try working on your accept rate. –  Publiccert Feb 25 '12 at 23:16
    
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

2 Answers 2

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

server myotherdomain.com{ 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.

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

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

 
discard

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.