Nginx upstream sent too big header

When I log in to a PrestaShop website, I get an error on a Plesk server.

502 Bad Gateway

On checking error login for the site in folder /var/www/vhosts/domain.com/logs/proxy_error_log, I found the following error message

proxy_error_log:2020/11/25 19:41:41 [error] 1809#0: *39664 upstream sent too big header while reading response header from upstream, client: 59.92.71.53, server: tulivesi.com, request: “POST /en/login?back=my-account HTTP/2.0”, upstream: “https://shop.serverok.in:7081/en/login?back=my-account”, host: “shop.serverok.in”, referrer: “https://shop.serverok.in/en/login?back=my-account”

To fix, add the following to Nginx config.

If Nginx works as a reverse proxy to another application server.

proxy_buffer_size          128k;
proxy_buffers              4 256k;
proxy_busy_buffers_size    256k;

If Nginx serve pages using FastCGI/fpm.

fastcgi_buffers 16 16k; 
fastcgi_buffer_size 32k;

On Plesk Server

On Plesk, go to the domain name, then click “Apache & nginx Settings”. On next page add the following code and click OK.

proxy_buffer_size          128k;
proxy_buffers              4 256k;
proxy_busy_buffers_size    256k;

Plesk Nginx

See Nginx

Need help with Linux Server or WordPress? We can help!

One thought on “Nginx upstream sent too big header

Leave a Reply

Your email address will not be published. Required fields are marked *