Skip to content

Error: 413 Request Entity Too Large

Ilia Rostovtsev edited this page Apr 28, 2019 · 1 revision

When running Webmin/Usermin, this error is usually initiated by your proxy server, upon uploading or saving large amounts of data.

What could cause it?

  1. Restricted total size of the HTTP request body sent from the client
  2. Web application firewall, such as ModSecurity

Solution Example.

It would be necessary to tweak your proxy web-server configuration. This is how it can be solved, in example of using Apache 2.4+ (for other web-servers it would be familiar).

The following options should be added to your VirtualHost configuration:

# This directive specifies the number of 
# bytes that are allowed in a request body
# https://httpd.apache.org/docs/2.4/mod/core.html#limitrequestbody
LimitRequestBody 0

# This directive can set various timeouts 
# for completing the TLS handshake, receiving 
# the request headers and/or the request body 
# from the client.
# https://httpd.apache.org/docs/2.4/mod/mod_reqtimeout.html#RequestReadTimeout
RequestReadTimeout handshake=0 header=20-40,MinRate=500 body=0,MinRate=500

# This directive disables ModSecurity 
# to inspect request body
<IfModule mod_security2.c>
    SecRequestBodyAccess Off
</IfModule>
Clone this wiki locally