: This article describes how to solve the 413RequestEntityTooLarge error in Nginx. For more information about PHP tutorials, see. Nginx has the 413 Request Entity Too Large error. this error usually occurs when uploading files. open the nginx main configuration file nginx. conf, locate the http {} segment, and add
The solution is
Open the nginx main configuration file nginx. conf. generally, find the http {} segment at/usr/local/nginx/conf/nginx. conf, modify or add
client_max_body_size 2m;
Restart nginx,
sudo /etc/init.d/nginxd reload
You can.
To run in php, the client_max_body_size value must be the same or slightly larger than the maximum value of the following value in php. ini, so that the error will not occur because the submitted data size is inconsistent.
post_max_size = 2Mupload_max_filesize = 2M
Restart NGINX
kill -HUP `cat /usr/local/nginx/nginx.pid `
When uploading large files, you must increase the value of max_execution_time appropriately to prevent timeout during slow network speeds.
The above describes how to solve the 413 Request Entity Too Large error in Nginx, including some content. if you are interested in the PHP Tutorial.