The file server reports an error of 413, and the file uploaded by nginx reports an error of 413 request entity too large

Please confirm the following parameters of php.ini file first

file_ uploads = on       // Whether to allow file upload via http. The default is on, that is, on

upload_ tmp_ dir         // The file is uploaded to the place where the temporary file is stored on the server. If it is not specified, the system default temporary folder will be used

upload_ max_ filesize = 10m       // That is, the maximum file size allowed to upload. The default is 2m

post_ max_ size = 10m    // It refers to the maximum value that can be received by PHP through form post, including all values in the form. The default is 8m

Generally, after setting the above four parameters, upload & lt= 10m files are not a problem under normal network conditions. But if you want to upload & gt; 10m large volume files, only setting the above four items may not work.

Further configure the following parameters

max_ execution_ time = 600     // The maximum running time of each PHP page (seconds), which is 30 seconds by default

max_ input_ time = 600     // The maximum time required for each PHP page to receive data is 60 seconds by default

memory_ limit = 128m      // The maximum memory consumed by each PHP page is 8m by default

If all the above settings are set and still cannot be uploaded, add a: client in the ngnix.conf configuration file of the website_ max_ body_ size 200m;

Read More: