Additional menu

Nginx – 413 Request Entity Too Large (while uploading wordpress theme)

Nginx – 413 Request Entity Too Large (while uploading wordpress theme)

Geek Flare Blog post is sponsored by Netsparker Web Application Security Scanner.

Setting up a website on VPS is always fun.

I selected DigitalOcean for Best Flare, and while uploading the WordPress theme, I got request entity too large error.

Are you in the same situation?

Error, which I got:

nginx-413-request-entity-too-large

Let’s find out how large was requested entity.

  • Login to Nginx server
  • Go to error file log location. Default location is /var/log/nginx/error.log
  • View the file and look for the error, you should see something like “client intended to send too large body.” This is what I was receiving in logs.
2015/06/12 23:10:47 [error] 1489#0: *10 client intended to send too large body: 8338355 bytes, client: 115.66.213.149, server: bestflare.com, request: "POST /bestflare/wp-admin/update.php?action=upload-theme HTTP/1.1", host: "bestflare.com", referrer: https://bestflare.com/bestflare/wp-admin/theme-install.php?upload

By default, Nginx is configured with 2 MB to accept the body size, and as you can see in a request, it was around 8.5 MB hence above error.

Fix request entity too large error

Add the following parameter in nginx.conf file. Default location is /etc/nginx/nginx.conf

client_max_body_size 10M;

I have added 10MB. Of course, you can adjust this based on the requirement.

To get this reflected, you need to restart the Nginx. Now you should be able to upload the WordPress themes.

Reader Interactions

Chandan Kumar
About Chandan
Chandan Kumar is the founder of Geek Flare. Learn more here and connect with him on Twitter.

Leave a Reply

Your email address will not be published. Required fields are marked *

Share
Tweet
Stumble
Share