Does each vhost need a different socket?

mr1031011 asked:

I have just started using nginx so I’m a bit confused with the socket setting. It seems like I have to set listen to /var/run/php5-fpm.sock for example. But if I have multiple sites running on the same server do I have to have different socket for each one? Say /var/run/site1.sock and /var/run/site2.sock?

Sorry for asking such question 🙁

My answer:


You don’t need different sockets for each virtual host.

You do, however, need different sockets for distinct php-fpm pools.

If you’re running all your virtual hosts in the same php-fpm pool, then you only need a single socket. However, if you move some of them into a different pool, that pool is a completely separate process group and needs a different socket.


View the full question and answer on Server Fault.

Creative Commons License
This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 Unported License.