Ubuntu Apache 2.4 Bad Request Size of a request header field exceeds server limit

Using 3rd party JS plugins, chats and analytics or misusing cookie storage may result in site failure due to large request.

Bad Request

There may be 2 reasons:

1. Total cookie size overflow (default can be 4kb or 8kb)

2. Cookie overflow (default 100)

In order to edit these parameters, we need in the .conf (/etc/apache2/site_avaliable/YourSite.conf) virtual host file or in the global apache2.conf (/apache2/apache2.conf) or depending on the version of OS - httpd.conf (/etc/httpd/conf/httpd.conf). Add the necessary parameters.

There are 3 of these parameters:

LimitRequestFieldSize size in bytes

LimitRequestLine size in bytes

LimitRequestFields maximum number of cookies

LimitRequestFieldSize - allows you to set the size limit for the HTTP request header field.

LimitRequestLine - limit on the length of the request URL allowed for a request on the server.

LimitRequestFields - Allows you to change the limit on the number of request header fields allowed in an HTTP request.

Add to VirtualHost (/etc/apache2/site_avaliable/YourSite.conf)

VirtualHost

Or adding to apache2.conf (/etc/apache2/apache2.conf)

apache2

remember that the values ​​of these parameters are taken from the first declaration. That is, if they are already registered in the global settings apache2.conf, then the settings in VirtualHost will not work.

Don't forget to do apache2 restart.

Source: site

3141 0

Comments

Be the first to review this item. Share your rating and review so that other customers can decide if this is the right item for them.
You have to log in to leave a comment. Sign in

Similar articles