Jul 14, 2016

413 Request Entity Too Large Nginx

railscapistrano-413-request-entity-too-large-nginx-wordpress-error


Let's go straight to the point. You need to modify max file size settings at two locations: php.ini and nginx.conf

For php.ini:
1) Open php.ini: vi /etc/php5/fpm/php.ini
2) Find upload_max_filesize = 2M
3) Change to upload_max_filesize = 32M (or larger)
4) Save and close php.ini
5) Restart services: sudo service php5-fpm restart


For nginx.conf:
1) Open nginx.conf: vi /etc/nginx/nginx.conf
2) Add this line if you cannot find it in the "http", "server" or "location" block: client_max_body_size ;
3) Modify it to 32M (or whatever size you set  in php.ini) like this: client_max_body_size 32M;
4) Restart nginx: sudo service nginx restart

No comments:

Post a Comment