Nginx使用502 Bad Gateway覆盖一般的symfony错误 [英] Nginx overwrites general symfony errors with 502 Bad Gateway
本文介绍了Nginx使用502 Bad Gateway覆盖一般的symfony错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
当我尝试访问不存在的路由或在Twig模板中出错时,我没有获得带有调试信息的Symfony错误页面,而是重定向到默认的Nginx 502错误网关.
When I try to access a non-existing route or make a mistake inside a Twig template, instead of getting the Symfony error page with debug information, I get redirected to a default nginx 502 Bad Gateway.
日志显示了有趣的一行:
The log shows an interesting line:
013/07/17 16:11:41 [error] 16952#0: *187 upstream sent too big header while reading
response header from upstream, client: 127.0.0.1, server: ftwo.localhost, request: "GET
/heasd HTTP/1.1", upstream: "fastcgi://127.0.0.1:9000", host: "ftwo.localhost"
有什么想法吗?
推荐答案
Increase your buffer size in nginx configuration and restart nginx afterwards as suggested here.
proxy_buffer_size 128k;
proxy_buffers 4 256k;
proxy_busy_buffers_size 256k;
进一步在配置的php部分(位置〜.php $)中增加fastcgi缓冲区
Further increase the fastcgi buffer in the php section of your configuration ( location ~ .php$ )
fastcgi_buffer_size 128k;
fastcgi_buffers 4 256k;
fastcgi_busy_buffers_size 256k;
来自CodeIgniter用户的问题的参考答案此处.
Referenced answer to a question from a CodeIgniter user here.
这篇关于Nginx使用502 Bad Gateway覆盖一般的symfony错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文