Nginx Overwrites Symfony Common Errors with 502 Bad Gateway

When I try to access a nonexistent route or make a mistake inside the Twig template, instead of getting a Symfony error page with debug information, I get redirected to Bad Gateway by default nginx 502.

An interesting line is shown in the log:

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" 

Any ideas?

+9
nginx symfony
Jul 17 '13 at 19:04 on
source share
2 answers

Increase the buffer size in the nginx configuration and then restart nginx 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; 

A directed answer to a question from a CodeIgniter user is here .

+19
Jul 17 '13 at 19:15
source share

You can also disable ChromePHP in app / config / config_dev.yml

Just comment out these lines:

 chromephp: type: chromephp level: info 

This plugin generates a large header and makes nginx respond with 502 Bad Gateway.

Additional Information:

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

Enable Debug Component in Symfony 2.3

+16
Aug 15 '13 at 10:25
source share



All Articles