`
willko
  • 浏览: 383809 次
  • 性别: Icon_minigender_1
  • 来自: 深圳
社区版块
存档分类
最新评论

nginx 502 Bad Gateway 错误问题收集

阅读更多
因为,nginx和lighttpd的文档真的很少,更不用说中文文档了,所以收集一些和502有关的错误在这里,保留来源地址,建议看来源地址的内容。

502是FastCGI出现问题,所以从FastCGI配置入手。

1.请检查你的FastCGI进程是否启动

2.FastCGI进程不够使用
请通过执行 netstat -anpo | grep "php-cgi" | wc -l 判断,是否接近你启动的FastCGI进程,接近你的设置,表示进程不够

来源:http://blog.s135.com/post/361.htm

3.执行超时
请把
fastcgi_connect_timeout 300;
fastcgi_send_timeout 300;
fastcgi_read_timeout 300;
这几项的值调高

来源:http://blog.s135.com/post/361.htm

4.FastCGI缓冲不够
nginx和apache一样,有前端缓冲限制
请把
fastcgi_buffer_size 32k;
fastcgi_buffers 8 32k;
这几项的值调高

来源:http://www.hiadmin.com/nginx-502-gateway-error一例/

5.Proxy缓冲不够
如果你使用了Proxying,请把
proxy_buffer_size  16k;
proxy_buffers      4 16k;
这几项的值调高

来源:http://www.ruby-forum.com/topic/169040

6.https转发配置错误
正确的配置方法
        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        Host $host;
                proxy_set_header        X-Real-IP $remote_addr;
                proxy_set_header        Destination $fixed_destination;
                proxy_pass              http://subversion_hosts;
        }

来源:http://www.ruby-forum.com/topic/173455

7.php脚本执行时间过长
将php-fpm.conf的<value name="request_terminate_timeout">0s</value>的0s改成一个时间

来源:http://blog.nowans.com/content/log.2008.10.29.229.html
分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics