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.

Got a comment?

captcha =


  1. System (20)
    1. FreeBSD (5)
    2. Linux (9)
  2. Email (2)
  3. DNS (2)
  4. Databases (1)
  5. WebServer (27)
Copyright © 2024 HowToUnix - *nix Howtos and Tutorials
All Rights Reserved.