Nginx Report 502 Bad Gateway Error resolution method

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.