当php-fpm返回500时,Nginx返回502错误 [英] Nginx returns 502 error when php-fpm returns 500
问题描述
我正在用php-fpm运行nginx.每当我的Symfony应用崩溃时,它将返回500错误,其中包含我需要的调试信息和堆栈跟踪.问题在于Nginx转储该信息并返回502错误且不包含任何内容.
I'm running nginx with php-fpm. Whenever my Symfony app crashes, it returns a 500 error with the debug info and stack traces I need. The problem is Nginx dumps that info and returns a 502 error with no content.
如何配置nginx来转发php-fpm中的500错误和内容?
How can I configure nginx to forward along the 500 error and content from php-fpm?
推荐答案
您可以使用"proxy_intercept_errors on"将错误代码传输到客户端. http://nginx.org/en/docs/http/ngx_http_proxy_module.html#proxy_intercept_errors
You can use "proxy_intercept_errors on" to transfer error code to client. http://nginx.org/en/docs/http/ngx_http_proxy_module.html#proxy_intercept_errors
这篇关于当php-fpm返回500时,Nginx返回502错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!