您好,欢迎访问一九零五行业门户网

nginx 502出错集锦 nginx负载均衡 实战nginx nginx反向代

nginx出现502 bad gateway 错误,
查了nginx的错误日志为:
[html] view plaincopy
2014/08/02 16:14:31 [error] 17029#0: *17941 recv() failed (104: connection reset by peer) while reading response header from 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: *3 recv() failed (104: connection reset by peer) while reading response header from upstream, 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”  
不要使用php-fpm的request_terminate_timeout,最好设成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 will  ; be killed. this option should be used when the ‘max_execution_time’ ini option  ; does not 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  
因为这个参数会直接杀掉php进程,然后重启php进程,这样前端nginx就会返回104: connection reset by peer。这个过程是很慢,总体感觉就是网站很卡。 以上就介绍了nginx 502出错集锦,包括了nginx,502方面的内容,希望对php教程有兴趣的朋友有所帮助。
其它类似信息

推荐信息