Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

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 setup with two small servers running nginx serving as proxy and a number of Apache+mod_php beefy servers. I am thinking on going over to PHP-FPM. Can I configure nginx to use a number of FastCGI servers? Or PHP-FPM itself to use workers on different machines? Or do I need to run nginx on the workers?

share|improve this question
up vote 6 down vote accepted

no you can run 1 nginx machine and many php-fpm machines.

upstream php {

Then in your locaction

fastcgi_pass php;
share|improve this answer
Thanks! That was totally not clear from the documentation. – chx Dec 28 '10 at 11:31
What about keep alive connections? What should the number of keep alive be? – CMCDragonkai Apr 15 '14 at 4:09

A complement to Mike's answer.

Check this vulnerability that can arise when you have nginx and PHP-FPM in different servers. The bottom line is: don't allow users to upload content to your public directory.

share|improve this answer

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.