Plesk

Pages of a website hosted in Plesk fail to load: Size of a request header field exceeds server limit

Symptoms

Website pages fail to open with the following error message in a web-browser:

Bad request
Your browser sent a request that this server could not understand.
Size of a request header field exceeds server limit.

Cause

Size of a request header field has exceeded the server limit defined in Apache configuration. The default Apache header size is 8 KB.

Resolution

 

For Apache on CentOS/RHEL-based distributions (global)

 

  1. Connect to the Plesk server via SSH.

  2. Create a backup of the Apache configuration file:

    # cp -a /etc/httpd/conf/httpd.conf /root/httpd.conf_`date +%F`

  3. Open the file in a text editor. In this example, we are using the vi editor:

    # vi /etc/httpd/conf/httpd.conf

  4. Add the following line and specify your value (16000 is an example):

    LimitRequestFieldSize 16000

  5. Save the changes and close the file.

  6. Restart the Apache service to apply the changes:

    # service httpd restart

    Note: In case the value of 16000 (16KB) is not enough, increase it to the greater value, for example, 32000 (32KB).

 

For Apache on Debian/Ubuntu-based distributions (global)

 

  1. Connect to the Plesk server via SSH.

  2. Create a backup of the Apache configuration file:

    # cp /etc/apache2/apache2.conf /etc/apache2/apache2.conf_`date +%F`

  3. Open the file in a text editor. In this example, we are using the vi editor:

    # vi /etc/apache2/apache2.conf

  4. Add the following line and specify your value (16000 is an example):

    LimitRequestFieldSize 16000

  5. Save the changes and close the file.

  6. Restart the Apache service to apply the changes:

    # service apache2 restart

    Note: In case the value of 16000 (16KB) is not enough, increase it to the greater value, for example, 32000 (32KB).

 

For nginx-only hosting (single domain)

 

If the website is using nginx-only hosting, apply the following steps:

  1. Log in to Plesk.
  2. Go to Domains > example.com > Hosting & DNS > Apache & nginx Settings.

  3. Add the following line to Additional nginx directives then hit Apply.

    large_client_header_buffers 4 16k;

    Note: Edit 16k to match whatever request buffer size you need keeping in mind 8k is default, and the larger the buffer size the greater the impact from a DDOS attack.