1
votes

I'm using nginx with a wildcard SSL cert. When I try to upload file bigger than 1Mb it return 413 Request Entity Too Large.

I've already set:

  1. client_max_body_size 100m; in http block of /etc/nginx/nginx.conf
  2. client_max_body_size 100m; in server block of /etc/nginx/sites-available/site.tld
  3. memory_limit = 512M / upload_max_filesize = 100M / post_max_size = 100M in php.ini

Restarted Nginx and FPM, nothing changes... I always get the error.

1

1 Answers

1
votes

Stop both nginx and php5-fpm and check if they are indeed stopped or not. Then do a start and check the status again.

If failure, reboot server and try again.

If it fails again, check that you don't have any other limit directly on your php files, such as this:

ini_set('post_max_size', '1M');

Are you testing this on a clean testing script, (one to two files) or on some cms / framework?

Try to change the limit to 2M and check if it fails with a smaller upload. Then go up until you find your limit.

Also please post your nginx and php.ini configuration here.