Home /NGINX /Request Entity too large when uploading themes in wordpress /

Request Entity too large when uploading themes in wordpress

2:17 am, April 23, 2017

Original Post Date: 11:54 pm, May 17, 2015

So i came across this one the other day when uploading a theme that was only about 1 meg to a wordpress site that i run on a nginx server.

I checked the php.ini and the max upload size it was set to 16meg, so it was not that. I found that it was a NGINX setting causing this issue.

You have to add this bit to your server file for the wordpress site: client_max_body_size 20M;

See the code below for the full server file for a wordpress site running on nginx.

Edit: also remember to restart nginx when applying this change! otherwise it will have no effect. service nginx restart

server { listen 80; server_name kruxor.com; access_log off; error_log /dev/null crit; root /var/www/wp; index index.html index.php; client_max_body_size 20M; #change the max upload size location / { index index.php index.html index.htm; try_files $uri $uri/ /index.php?$args; } fastcgi_param HTTPS off; include /etc/nginx/include/ssl; include /etc/nginx/include/php; }