Nginx Proxies with FirePHP
16 Jun
FirePHP is a great plugin for php+ajax devs — in essence, it captures error and logging output and sends it over HTML headers instead of the content body. These logs show up in your firebug console alongside your javascript logs, making it great for ajax development. You want your output clean but your error and logging info accessible, and lets face it, tail -f is just not as sexy as firebug.
If you’re running your development environment behind an nginx proxy, you may run into some 502 Bad Gateway errors after enabling FirePHP.
[error] 103#0: *839 upstream sent too big header while reading response header from upstream
This happens because FirePHP’s output can get pretty large, and nginx by default tries to cap header output. The fix is simple, in your nginx.conf simply add the following lines:
proxy_buffer_size 16k;
proxy_buffers 4 16k;
You can bump up the header size (the last parameter) to whatever is required by your app to stop throwing errors.

Recent Comments