Nginx: 413 Request Entity Too Large

From lxadm | Linux administration tips, tutorials, HOWTOs and articles
Jump to: navigation, search

If you're seeing HTTP 413 "Request Entity Too Large" errors in your nginx logs, most likely this is caused by file uploads larger than allowed by nginx.

To change it, add a larger client_max_body_size value to your nginx config. By default, the value is 1 megabyte. To change it, add (or, change, if you use this directive already) - here we allow 8 megabyte uploads:

	client_max_body_size 8m;

client_max_body_size can be placed in http, server, location in nginx config.

Setting size to 0 disables checking of client request body size.