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:
1 |
vim /etc/nginx/nginx.conf |
..and add client_max_body_size to the http-section:
1 |
client_max_body_size 20M; |
Save and close the file, apply the changes to nginx, and reload:
1 2 |
/usr/sbin/nginx -t /usr/sbin/nginx -s reload |
Try uploading again. Should be working. :)
Goooooooooooooooooood~~
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!
You’re welcome, glad it helped! :)
Many Thanks for your help.
Regards
Awais
great… Thanks.