Nginx 413RequestEntityTooLarge error solution

Source: Internet
Author: User
: 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.

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.