Nginx returns 502 error when php-fpm returns 500

萝らか妹 提交于 2019-12-11 11:08:34

问题


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.

How can I configure nginx to forward along the 500 error and content from php-fpm?


回答1:


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




回答2:


If your Symfony app crashes before any content was returned, then there is no content.



来源:https://stackoverflow.com/questions/21784601/nginx-returns-502-error-when-php-fpm-returns-500

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!