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 am running several websites on Apache currently utilizing name-based vhosts. All of the sites are on the same server. I would like to add Ngnix on a new server to sit in front of Apache as a caching reverse proxy.

What is the best way to handle the multiple name-based vhosts? Should I simply have Nginx handle the names and run each Apache vhost on a separate port? Or is there a way to just have Nginx pass the hostname to Apache and have apache take care of the domain names?

share|improve this question

2 Answers 2

up vote 1 down vote accepted

As a reverse proxy, Nginx will pass the Host: header for Apache to use. There is absolutely no reason to put Apache vhosts on separate ports.

share|improve this answer

If all your sites are on the same apache server, you need only apache a Name-based Virtual Host configuration.

share|improve this answer

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.