413 Request Entity Too Large - File Upload Issue 413 Request Entity Too Large - File Upload Issue nginx nginx

413 Request Entity Too Large - File Upload Issue


Source:http://www.cyberciti.biz/faq/linux-unix-bsd-nginx-413-request-entity-too-large/

Edit the conf file of nginx:

nano /etc/nginx/nginx.conf

Add a line in the http section:

http {    client_max_body_size 100M;}

Doen't use MB it will not work, only the M!

Also do not forget to restart nginx

systemctl restart nginx


-in php.ini (inside /etc/php.ini)

 max_input_time = 24000 max_execution_time = 24000 upload_max_filesize = 12000M post_max_size = 24000M memory_limit = 12000M

-in nginx.conf(inside /opt/nginx/conf)

client_max_body_size 24000M

Its working for my case


First edit the Nginx configuration file (nginx.conf)

Location: sudo nano /etc/nginx/nginx.conf

Add following codes:

http {        client_max_body_size 100M;}

Then Add the following lines in PHP configuration file(php.ini)

Location: sudo gedit /etc/php5/fpm/php.ini

Add following codes:

memory_limit = 128M post_max_size = 20M  upload_max_filesize = 10M