Posts

Showing posts from September, 2017

[Vagrant] 413 request entity too large for nginx/1.8

If you are using Vagrant and rasmus vagrant box , you may find that you cannot upload a large file (like 200MB) to your local server, result in error: 413 request entity too large  / nginx/1.8 And if you add client_max_body_size 200M; in your /etc/nginx/conf.d/xxxx.conf server context, it does not work. Increase the value of max_post_size and upload_max_filesize in your php.ini (/etc/php71/php.ini or /etc/php56/php.ini) post_max_size=200M upload_max_filesize=200M did not work. What works? Stop the php-fpm service (sudo systemctl stop php-fpm) and nginx service (sudo systemctl stop nginx) Yes you need to add post_max_size=200M and upload_max_filesize=200M, and also realpath_cache_size=200M in your php.ini Open /etc/nginx/nginx.conf, inside http{}, add client_max_body_size 200M; (remember to add the semi-colon at the end). Start the php-fpm service (sudo systemctl start php-fpm) and nginx service (sudo systemctl start nginx) again. Done! Hope it helps someon