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
-
Connect to the Plesk server via SSH.
-
Create a backup of the Apache configuration file:
# cp -a /etc/httpd/conf/httpd.conf /root/httpd.conf_`date +%F`
-
Open the file in a text editor. In this example, we are using the vi editor:
# vi /etc/httpd/conf/httpd.conf
-
Add the following line and specify your value (16000 is an example):
LimitRequestFieldSize 16000
-
Save the changes and close the file.
-
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).
-
Connect to the Plesk server via SSH.
-
Create a backup of the Apache configuration file:
# cp /etc/apache2/apache2.conf /etc/apache2/apache2.conf_`date +%F`
-
Open the file in a text editor. In this example, we are using the vi editor:
# vi /etc/apache2/apache2.conf
-
Add the following line and specify your value (16000 is an example):
LimitRequestFieldSize 16000
-
Save the changes and close the file.
-
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).
If the website is using nginx-only hosting, apply the following steps:
- Log in to Plesk.
-
Go to Domains > example.com > Hosting & DNS > Apache & nginx Settings.
-
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.