Top Nav

Fixing “Size of a request header field exceeds server limit.” error

This error from Apache is typically caused by a very large cookie. In Apache the “LimitRequestFieldSize” directive sets this limit. The default is 8190 bytes. To change the file create a file at:

/etc/httpd/conf.d/custom.conf

or

/etc/apache2/conf.d/custom.conf

containing the desired change:

Reload Apache after adding the file with:

/sbin/service apache2 restart

or

/sbin/service httpd restart

0

AWS CLI V2 Install

Using the bundled installer it’s easy to install or upgrade to version 2 of the AWS CLI:

Here’s a link to full instructions:

https://docs.aws.amazon.com/cli/latest/userguide/install-cliv2-linux.html

0

Expires Header In Nginx On Plesk

Trying to add an Expires header in Nginx on a Plesk server like this is problematic.

The “location” directive conflicts (overrides) the “location” directive created by Plesk. The work around is to disable “Serve static files directly by nginx” but this is a valuable feature that we usually don’t want to turn off.

An alternative is to use a “map” directive. Setup the map in the global nginx config by creating /etc/nginx/conf.d/expires_map.conf with:

Next in the “Additional nginx directives” field add:

This works well but may not be possible on a shared server where the global nginx configuration can not be changed.

0

Nginx Redirects With Map File

Client provided a CSV file with several thousand redirects for site hosted on Plesk server. For maximum efficiency we implemented the redirects using a map file in Nginx.

Start by convert the CSV file to a map include file with one redirect per line, space delimited and terminated with a colon. For example:

I placed the file at:

/var/www/vhosts/acme.com/redirects/redirect.map

Next step is to add to global nginx config by creating a file at:

/etc/nginx/conf.d/redirect_maps.conf

containing:

Finally in Plesk, for the target subscription (acme.com) in “Apache & Nginx Setting” add the following to “Additional Nginx directives:

0