nginx php file forwarded to php-fpm server prompts 502 errors

Experiments will be forwarded to the php file php-fpm when another server process, there have been 502 error:

Check out nginx error log, indicating:

 

2019/08/25 17:54:56 [error] 4742#0: *35 recv() failed (104: Connection reset by peer) while reading response header from upstream, client: 192.168.2.1, server: www.133.com, request: "GET /index.php HTTP/1.1", upstream: "fastcgi://192.168.2.133:9000", host: "192.168.2.132"

 

Follow the prompts to the method of operation of the Internet can not solve, but also 502, should communicate with PHP-FPM have a problem immediately returned. Then check the configuration file www.conf php-fpm, the listening port should be right listen = 9000 means that all terminals allow access to port 9000 , look at the next configuration,   listen.allowed_clients = 0.0.0.0

This means that all normal IP addresses. Later, I tried to change this configuration comments or nginx server ip address, restart php-fpm be able to access the service. I really can not say fuck. Small problems do half a day ah.

 

Guess you like

Origin www.cnblogs.com/hhsh/p/11408706.html