About Us
IDKBlogs

  All  
Javascript
NodeJS
AngularJS
Angular2+
ReactJS
Others

Nginx: 413 “Request Entity Too Large” in Nginx with “client_max_body_size” Error and Solution.

  idkblogs.com      November 29, 2017

Shubham Verma

Shubham Verma


Nginx: 413 “Request Entity Too Large” in Nginx with “client_max_body_size” Error and Solution.

I

If you are working with Nginx Server, then its possible that any point of time you can face this "Nginx: 413 Request Entity Too Large" issue. 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. Dont't worry, you are at right place to get rid off this kind of issue. Here you will get the correct solution to remove this issue. You need to read this article very carefully.

Request Entity Too Large in Nginx with client_max_body_size: idkblogs.com

Source: idkblogs.com

Follow the step to remove error "Request Entity Too Large in Nginx with client_max_body_size" you need to change the config file of your nginx sever.

Error: 413 “Request Entity Too Large” in Nginx with “client_max_body_size”

Step 1: Connect to your nginx server with your terminal:

You need to connect your terminal/CMD with ngnix server using below command:

ssh -i YOUR_PEM_FILE.pem [email protected]_IP -v

Example:

ssh -i pemFile.pem [email protected] -v

Step 2: Go to the config location and open it:

After the successful connection, you need to open the config file of Nginx, The below command should open a file, which is your nginx config file:

sudo nano /etc/nginx/nginx.conf

For more details, see in the below image:

Request Entity Too Large in Nginx with client_max_body_size: idkblogs.com

Source: idkblogs.com


Step 3: Search for this variable "client_max_body_size":

If you find it, just increase its size to 100M ( What ever you want ), If it doesn’t exist, then you can add below code inside and at the end of http:

client_max_body_size 100M;

For more details, see in the below image:

Request Entity Too Large in Nginx with client_max_body_size: idkblogs.com

Source: idkblogs.com

Step 4: Save this file:

Now you need 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

For more details, see in the below image:

Request Entity Too Large in Nginx with client_max_body_size: idkblogs.com

Source: idkblogs.com

Step 4: That's it

Now you should get rid of this problem.

Conclusion:

In this article, we learned how we can get rid of from this nginx problem, and how we can modify the configuration file of nginx server.


Thank you

for taking the time to read this article. If you’re interested in Node.js or JavaScript this link will help you a lot.



Copyright © 2020 IDKBlogs | All Right Reserved

About Us

Powered by : IDKBlogs

Last Update : 19/09/2020