简体   繁体   中英

413 Request Entity Too Large - Nginx 1.8.1

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.

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM