Nginx+php-fpm+mysql website, visit Nginx a page, reported 502 Gateway error, generally see this error, can judge is php-fpm problem, not nginx problem. By monitoring the Nginx error log, the following error is found:
Upstream sent too big header while reading response headers from upstream
Solve this problem with Google:
In nginx.conf
the HTTP segment, add the following configuration:
proxy_buffer_size 128k;
proxy_buffers 32 32k;
proxy_busy_buffers_size 128k;
Restart after the general can be resolved, if it is reported 502, and then in the host configuration of the PHP section to add the following configuration:
fastcgi_buffer_size 128k;fastcgi_buffers 4 256k;fastcgi_busy_buffers_size 256k;
Restart Nginx.
Reference URL: http://henter.me/post/nginx-error-upstream-sent-too-big-header-while-reading-response-header-from-upstream.html
http://www.nginxtips.com/502-bad-gateway-using-nginx/
Nginx Report 502 Bad Gateway Error resolution method