This is happening because of your nginx server not allow to upload file which is larger than defined size in nginx config file.To solve it , you have to modify your nginx configuration.
Follow the step to remove/modify your nginx config file.
Step 1: Connect to your nginx server with your terminal.
Ex: ssh -i pemFile.pem username@11.108.349.88 -v
Step 2: Go to the config location and open it
sudo nano /etc/nginx/nginx.conf
Step 3: Search for this variable: client_max_body_size
. If you find it, just increase its size to 100M,
If it doesn’t exist, then you can add below code inside and at the end of http:
client_max_body_size 100M;
Step 4: Save this file. ( If you want to save the changes you’ve made, press Control + O . To exit nano, type Control + X . If you ask nano to exit from a modified file, it will ask you if you want to save it.)
Step 5: Restart nginx to apply the changes.
sudo service nginx restart
That’s all!
Article Source: Medium (Shubham Verma)
Share This
Be the first to comment