while running on Amazon server instance with Nginx, at some point you might come across an HTTP 413 error that says
request too large
This means that the upload max size has been exceeded. To solve this error follow the steps below
How To solve NGNIX 413 Request Too Large Error
Login to your server via ssh
open the Nginx config file via nano or your favorite text editor. we will use nano for this tutorial
sudo /etc/nginx/nginx.conf
Add this code to the HTTP block
client_max_body_size 20M;
Increase the size as you wantsave the file and close the editor
Run this command to restart Nginx
sudo systemctl restart nginx
Now go back and retry the upload again, and it will work
What we have done is increase the maximum allowed file upload size to 20 megabytes. This way any file less than or equal to 20M will be uploaded
So feel free to adjust the value to your need
Top comments (0)