简体   繁体   English

当php-fpm返回500时,Nginx返回502错误

[英]Nginx returns 502 error when php-fpm returns 500

I'm running nginx with php-fpm. 我正在用php-fpm运行nginx。 Whenever my Symfony app crashes, it returns a 500 error with the debug info and stack traces I need. 每当我的Symfony应用程序崩溃时,它会返回500错误,其中包含我需要的调试信息和堆栈跟踪。 The problem is Nginx dumps that info and returns a 502 error with no content. 问题是Nginx转储该信息并返回502错误且不包含任何内容。

How can I configure nginx to forward along the 500 error and content from php-fpm? 我如何配置nginx来转发500错误和来自php-fpm的内容?

You can use "proxy_intercept_errors on" to transfer error code to client. 您可以使用“ proxy_intercept_errors on”将错误代码传输到客户端。 http://nginx.org/en/docs/http/ngx_http_proxy_module.html#proxy_intercept_errors http://nginx.org/en/docs/http/ngx_http_proxy_module.html#proxy_intercept_errors

如果您的Symfony应用在返回任何内容之前崩溃,则没有任何内容。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM