My apache server sends a "Request Entity too Large" error, when I am trying to upload a file. This happens when the actual "post body" is sent by the client after about 10 seconds of sending the "request header". Is there any way to disable this on Apache.
4 Answers
There's a method using mod_security, assuming you don't mind making it much larger:
You can also limit the size of the HTTP request body data. This is very handy for disabling large data in HTTP POST requests.
SecRequestBodyLimit 10485760
This is probably worth a read about any consequences of such a change: Mod Security HOWTO
-
1Was looking for a reason why for hours and completely forgotten about enabled
mod_security
and its directives! Thanks! Jan 21, 2014 at 11:16
If you're using PHP on the server to upload the file, you might want to look in your apache configs for something that looks like "LimitRequestBody"
or other restrictions on the size of the data allowed for upload. post_max_size
is another thing to look for in php.ini, along with upload_max_filesize
I found the answer. There is a Apache setting for this:
RequestReadTimeout
More can be found at:
-
6The document say that it returns 408 REQUEST TIME OUT, not 413 Request Entity Too Large.– petertcApr 8, 2016 at 8:32
It's what worked for me:
in modsecurity.conf file
On my Ubuntu 14.04 the config file is here but this really depends on the system:/etc/modsecurity/modsecurity.conf
change this two commands to this values:
SecRequestBodyLimit 13107200
SecRequestBodyNoFilesLimit 13107200