Solution to 413 Request Entity Too Large error handling, 413 entity
Idea 1: Modify nginx Configuration This is the simplest way. The error is that nginx does not allow uploading files with too many configuration items, so you can increase the nginx upload size configuration.1. Open the nginx main configuration file nginx. conf. Generally, in the/usr/local/nginx/conf/nginx. conf location, locate the http {} segment and modify the following content: [Html]View plain copy
Client_max_body_size2m;Change the value of 2 m to the allowed file size you need.2. Check whether the nginx configuration is correct after modification.[Html]View plain copy
/Usr/local/nginx/sbin/nginx-t3. After testing the correct configuration, restart nginx to make the configuration take effect.[Html]View plain copy
/Etc/init. d/nginxrestartNOTE: If it is run in php, The client_max_body_size value must be the same or slightly larger than the following value in php. ini, so that the error will not occur because the submitted data size is inconsistent.[Html]View plain copy
Post_max_size = 2Mupload_max_filesize = 2 M
Change the value of 2 m to the allowed file size you need. Change 2 m to the size you set in the first step.