Nginx: connect () failed (111: connection refused) when connecting to upstream

Trying to deploy my first portal.

I get a 502 gateway timeout error in the browser when I sent a request through the browser

when i checked the logs i got this error

2014/02/03 09:00:32 [error] 16607#0: *1 connect() failed (111: Connection refused) while connecting to upstream, client: 14.159.131.19, server: foo.com, request: "GET HTTP/1.1", upstream: "fastcgi://127.0.0.1:9000", host: "22.11.180.154" 

are there any permissions issues

+59
php nginx fastcgi
Feb 03 '14 at 10:06
source share
1 answer

I don’t think the solution will work anyway, because you will see an error message in the error log file.

The solution was much simpler than I thought.

just open the following path to your php5-fpm

 sudo nano /etc/php5/fpm/pool.d/www.conf 

or if you are the root administrator

 nano /etc/php5/fpm/pool.d/www.conf 

Then find this line and uncomment it:

 listen.allowed_clients = 127.0.0.1 

This solution will allow you to use listen = 127.0.0.1:9000 in your vhost blocks

: fastcgi_pass 127.0.0.1:9000;

after making changes all you need to do is restart or restart Nginx and Php5-fpm

php5-fpm

 sudo service php5-fpm restart 

or

 sudo service php5-fpm reload 

Nginx

 sudo service nginx restart 

or

 sudo service nginx reload 

From the comments:

Also a comment

 ;listen = /var/run/php5-fpm.sock 

and add

 listen = 9000 
+69
Jun 13 '14 at 5:30
source share



All Articles