Nginx overwrites general symfony errors with 502 Bad Gateway

后端 未结 2 1709
孤街浪徒
孤街浪徒 2020-12-29 10:08

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 d

相关标签:
2条回答
  • 2020-12-29 10:44

    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;
    

    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;
    

    Referenced answer to a question from a CodeIgniter user here.

    0 讨论(0)
  • 2020-12-29 10:49

    You may also try to disable ChromePHP at app/config/config_dev.yml

    Just comment out these lines:

    chromephp:
        type:   chromephp
        level:  info
    

    This plugin generates a large header and forces nginx to response with 502 Bad Gateway.

    More info at:

    https://github.com/symfony/symfony/issues/8413

    Enable Debug Component in Symfony 2.3

    0 讨论(0)
提交回复
热议问题