Nginx appears 502 bad Gateway error,
The error log for Nginx has been checked:
[HTML] View plaincopy
- 2014/08/02 16:14:31 [ERROR] 17029#0: *17941 recv () failed (104:connection reset by peer) while reading response header fr Om upstream, client:210.61.12.2, server:blog.lixiphp.com, Request: "post/api/1.0 Http/1.1″, upstream:" fastcgi://127.0 .0.1:9000″, Host: "Blog.lixiphp.com"
- 2014/08/02 16:24:52 [ERROR] 29615#0: * RECV () failed (104:connection reset by peer) and reading response header from U Pstream, client:58.220.197.35, server:blog.lixiphp.com, Request: "Get/404 Http/1.1″, upstream:" fastcgi:// 127.0.0.1:9000″, Host: "Blog.lixiphp.com"
Do not use PHP-FPM request_terminate_timeout, preferably set to request_terminate_timeout=0;
[HTML] View plaincopy
- Vi/etc/php-fpm.d/www.conf
[HTML] View plaincopy
- ; The timeout for serving a single request after which the worker process would
- ; Be killed. This option should is used when the ' max_execution_time ' ini option
- ; Does not a stop script execution for some reason. A value of ' 0′means ' off '.
- ; Available units:s (econds) (default), M (inutes), H (ours), or D (ays)
- ; Default value:0
- Request_terminate_timeout = 0
Because this parameter will directly kill the PHP process, and then restart the PHP process, so that the front-end Nginx will return 104:connection reset by peer. This process is very slow, the overall feeling is that the website is very card.
The above describes the Nginx 502 error collection, including the nginx,502 aspects of the content, I hope that the PHP tutorial interested in a friend helpful.