Websites are unavailable with 502 Bad Gateway: upstream sent too big header while reading response header

Created:

2016-12-12 03:42:37 UTC

Modified:

2017-08-16 16:30:22 UTC

3

Was this article helpful?


Have more questions?

Submit a request

Websites are unavailable with 502 Bad Gateway: upstream sent too big header while reading response header

Applicable to:

  • Plesk 12.5 for Linux
  • Plesk 11.x for Linux
  • Plesk 12.0 for Linux

Symptoms

  1. Websites are unavailable:

    502 Bad Gateway
  2. In the log files /var/log/nginx/error.log or /var/www/vhosts/example.com/logs/proxy_error_log the following error message can be found:

    2015/08/25 01:13:40 [error] 14790#0: *188 upstream sent too big header while reading response header from upstream, client: 203.0.113.2, server: subdomain.example.com, request: "POST /admin_catalog.php HTTP/1.1", upstream: "http://10.0.0.1:7080/admin_catalog.php", host: "subdomain.example.com", referrer: "http://subdomain.example.com/admin_catalog.php"

Cause

Request cannot be processed by proxy server because of insufficient its buffer size.

Resolution

If the issue occurs only for one domain, add the following parameters to Additional nginx directives section in Home > Domains > example.com > Apache & nginx Settings :

    proxy_buffers 8 16k;
proxy_buffer_size 32k;
  1. To increase proxy buffer size on a server level, add the following records in /etc/nginx/nginx.conf under http { section:

    proxy_buffers 8 16k;
    proxy_buffer_size 32k;
  2. Restart nginx :

    service nginx restart

Increase values of these parameters if it is needed.

Have more questions? Submit a request
Please sign in to leave a comment.