[转]nginx 502 Bad Gateway 错误积累与总结
转载自: http://blog.sina.com.cn/s/blog_601d49a30100ek89.html
1.请检查你的FastCGI进程是否启动
请通过执行 netstat -anpo | grep "php-cgi" | wc -l
判断,是否接近你启动的FastCGI进程,接近你的设置,表示进程不够
fastcgi_connect_timeout 300;
fastcgi_send_timeout 300;
fastcgi_read_timeout 300;
这几项的值调高
nginx和apache一样,有前端缓冲限制
请把
fastcgi_buffer_size 32k;
fastcgi_buffers 8 32k;
这几项的值调高
如果你使用了Proxying,请把
proxy_buffer_size
proxy_buffers
这几项的值调高
正确的配置方法
server_name www.mydomain.com;
location /myproj/repos {
set $fixed_destination $http_destination;
if ( $http_destination ~* ^https(.*)$ )
{
set $fixed_destination http$1;
}
proxy_set_header
proxy_set_header
proxy_set_header
proxy_pass
}
将php-fpm.conf的<value
name="request_terminate_timeout">0s</value>的0s改成一个时间