DEV Community

Matthew LaFalce
Matthew LaFalce

Posted on

Error: 413 “Request Entity Too Large” in Nginx

Why am I seeing Error: 413 “Request Entity Too Large” in Nginx?

This is happening because your nginx server does not allow you to upload a file that is larger than the defined size in nginx config file. To solve it, you have to modify your nginx configuration.

Follow the step to add/modify your nginx config file.

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

ssh user@my_server
Enter fullscreen mode Exit fullscreen mode

Step 2: Go to the config location and open it

sudo vim /etc/nginx/nginx.conf
Enter fullscreen mode Exit fullscreen mode

Step 3: Adding/Modifying the client_max_body_size variable

If you find it, just increase its size to 100M,
If it doesn’t exist, then you can add the below code inside and at the end of HTTP settings:

client_max_body_size 100M;
Enter fullscreen mode Exit fullscreen mode

Step 4: Restart nginx to apply the changes

sudo service nginx restart
Enter fullscreen mode Exit fullscreen mode

Top comments (0)