• Please be aware: Kaspersky Anti-Virus has been deprecated
    With the upgrade to Plesk Obsidian 18.0.64, "Kaspersky Anti-Virus for Servers" will be automatically removed from the servers it is installed on. We recommend that you migrate to Sophos Anti-Virus for Servers.
  • The Horde webmail has been deprecated. Its complete removal is scheduled for April 2025. For details and recommended actions, see the Feature and Deprecation Plan.
  • We’re working on enhancing the Monitoring feature in Plesk, and we could really use your expertise! If you’re open to sharing your experiences with server and website monitoring or providing feedback, we’d love to have a one-hour online meeting with you.

Resolved NGINX error: upstream sent too big header

five

New Pleskian
Hello everybody,

we receive errors during working with WordPress installations on our server:

84381#0: *2908 upstream sent too big header while reading response header from upstream

Sometimes when updating plugins, but also when just clicking around.
An example out of our logfile is attached.

This is our modified "/etc/sw-cp-server/config" file:

Code:
worker_processes  1;

events {
    worker_connections  65536;
    use epoll;
    multi_accept on;
}

http {
    include       mime.types;
    default_type  application/octet-stream;

    log_format  main  '$remote_addr - $remote_user [$time_local] "$request" '
                      '$status $body_bytes_sent "$http_referer" '
                      '"$http_user_agent" "$http_x_forwarded_for"'
                      "'$fastcgi_script_name' '$fastcgi_path_info' '$document_root'";


    sendfile        on;
    reset_timedout_connection on;

    #keepalive_timeout  0;
    keepalive_timeout  65;
    #tcp_nodelay        on;

    #gzip  on;
    #gzip_disable "MSIE [1-6]\.(?!.*SV1)";

    server_tokens off;

    fastcgi_max_temp_file_size 0;
    fastcgi_buffers 128 2048k;
    fastcgi_buffer_size 2048k;

    fastcgi_read_timeout 600;
    fastcgi_send_timeout 600;

    client_body_buffer_size      128k;
    client_max_body_size 2048m;
    client_header_buffer_size    1k;
    large_client_header_buffers  4 4k;
    output_buffers               1 32k;
    postpone_output              1460;


    error_page 497 https://$hostname:$server_port$request_uri;

    include /etc/sw-cp-server/conf.d/*.conf;
}


Anybody has an idea what to do to get this thing working fine?

  1. Is changing the nginx proxy buffer size a solution?
 

Attachments

  • plesk-log-nginx-error.png
    plesk-log-nginx-error.png
    295.9 KB · Views: 35
Usually this issue is caused by the existence of a large number of files in the directory that you tried to open. Try to increase the FastCGI buffer size to resolve the issue as below:

# cat /etc/sw-cp-server/config | grep 'fastcgi_buffer'
fastcgi_buffers 128 4096k;
fastcgi_buffer_size 4096k;
 
Hi Igor and thanks for this, but it didn't solved the problem until now...
Can reproduce this error everytime now by for example cleaning the cache of my Wordpress WP Rocket Cache plugin...
But also when just logged in the backend the errors appears (as seen in the screenshot above).

Tried to original Plesk nginx conf and also your config and some different ones... Nothing solved the problem.
 
Hi @five
The error in your screenshot are at the domain level, so you either need to add the directives under the domain

Plesk > Subscriptions > domain.tld > Apache & Nginx Settings > Additional Nginx Directives.

Or you can add them in the main server config (Globally)...

/etc/nginx/conf.d

The configuration you were editiing was just for Plesk's own server.../etc/sw-cp-server/
Domains are served via

/etc/apache2/
/etc/nginx/

Kind regards

lloyd
 
Hi lloyd!
Thank you - this was the main problem...

But finally I resolved my upstream problem not with changing the fastcgi settings but with changing it to exactly this settings:

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

I created a .conf file just for this and in /etc/nginx/conf.d
 
Hi lloyd!
Thank you - this was the main problem...

But finally I resolved my upstream problem not with changing the fastcgi settings but with changing it to exactly this settings:

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

I created a .conf file just for this and in /etc/nginx/conf.d

Thank you so much, I was going crazy trying to fix various 502 errors in the SilverStripe CMS backend. Added these directives to nginx and now it works flawlessly.
 
Hi lloyd!
Thank you - this was the main problem...

But finally I resolved my upstream problem not with changing the fastcgi settings but with changing it to exactly this settings:

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

I created a .conf file just for this and in /etc/nginx/conf.d
really sorry for digging out this really old message, but is it enough to place it under /etc/nginx/conf.d/ and there in a file like example.conf and restart the nginx service? Is it then applied to all domains on the plesk server?
 
Back
Top