Nginx – Error 413: Request entity too large

The default maximum body size of a client request, or maximum file size, that nginx allows you to have, is 1M. So when you try to upload something larger than 1M, you get the following error:

413: Request Entity Too Large.

Changing your php.ini-settings alone won’t do much. So to fix this problem, follow these steps.

Open up your nginx.conf-file, with an editor of your choice:

..and add client_max_body_size to the http-section:

Save and close the file, apply the changes to nginx, and reload:

Try uploading again. Should be working. :)

5 thoughts on “Nginx – Error 413: Request entity too large

  1. Edller

    Thank you very much, you saved my day!
    Initially, I just added the client_max_body_size to the conf file and it did not work.
    Afterwords, I perceived it was in a wrong place (inside other server directive under http session).
    I moved it to the http session and tada!
    It worked like a charm, thanks!

    Reply

Leave a Reply

Your email address will not be published. Required fields are marked *