How to fix 413 error: Request Entity Too Large in Nginx
This error occurs when the size of transferred file exceeds 1 megabyte. It happens because Nginx directive client_max_body_size is set to 1M by default.
client_max_body_size directive specifies the maximum accepted body size of a client request indicated by the request header Content-Length.
If content length is greater than specified limit, the client receives 413 error: "Request Entity Too Large". It's also known that web browsers don't usually know how to display this error properly.
To solve this change client_max_body_size directive in nginx.conf file:
client_max_body_size 100m;and restart nginx.
See also:
- How to fix accept() failed (24: Too many open files) error in Nginx
- How to fix "upstream timed out (110: Connection timed out) while reading" error in Nginx and PHP-FPM
- How to install Nginx on CentOS
- How to install Nginx in FreeBSD
- NAXSI: protecting websites with Nginx
- How to install Nginx, PHP 5.3.10 and PHP-FPM on CentOS 5.7 — 6.2
Got a comment?
All Rights Reserved.