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.

Background: 3 servers, 1 load balancer and 2 PHP app servers.

Do I need to install nginx on the 2 app servers? Or can I pass directly from the load balancer to PHP-FPM running on the app servers?

share|improve this question
add comment

1 Answer

Yes, you can. First you need to configure PHP-FPM to listen on an external IP instead of localhost, which is the default. Add/change the following in php-fpm.conf (on Ubuntu it's defined in /etc/php5/fpm/pool.d/www.conf):

listen = 9000

and restart PHP-FPM. Make sure that that port number is allowed by any firewalls between the load balancer and the app servers. The configure nginx to proxy to the app servers on that port number:

upstream php {
    server 192.168.0.10:9000;
    server 192.168.0.11:9000;
}

fastcgi_pass php;
share|improve this answer
add comment

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.