Nginx upload file returned 413 resolution

Source: Internet
Author: User

When uploading a file over HTTP, return 403 Request Entity Too large error, because the default setting allows the upload file is too small, the default is 2M, if the upload file size is greater than 2M, then will return 413 error, Modify Nginx configuration file nginx.conf, in the HTTP {} segment, the server {} Outside of the client_max_body_size option, if the comment should be removed if the comment modified value, if you do not need to manually add, the following configuration:

Client_max_body_size 8m;

This is changed to 8m, usually enough, after saving to execute ./sbin/nginx-s Reload Reload the configuration file to take effect, uploading the file again is normal.

LNMP Environment, PHP itself also has to handle the upload file size settings, which need to modify the PHP installation directory under the php.ini configuration file, modified to the following configuration:

Post_max_size == 8M

Once saved, reboot php-fpm to take effect

Linux under the nginx,php environment, it is generally necessary to modify the above parameters to achieve the size limit of the upload file

Nginx upload file returned 413 resolution

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.