Error: 413 “Request Entity Too Large” in Nginx with “client_max_body_size” / Changes in Nginx config file.

Loading

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
0Shares

0
See also  “php get user ip” Code Answer

Leave a Reply

Back to top of page

Register / Login

Message from SUPEDIUM


Welcome to SUPEDIUM, to ensure you have seamless experience when browsing our website, we encourage all users to register or login. It only takes less than 2 minutes to register an account :)

Register / Login with Email

Register / Login with Google

This will close in 30 seconds

Sign in

rotate_right

Send Message

image

My favorites

image