Solution to the 413RequestEntityTooLarge problem in nginx

Source: Internet
Author: User
: This article describes how to solve the 413RequestEntityTooLarge problem in nginx. For more information about PHP tutorials, see. Solution to the 413 Request Entity Too Large problem in nginx

The nginx: 1.9 Request Entity Too Large error occurs when uploading images (413 MB in size) using php.

Based on experience, the server limits the size of the uploaded files, but the default php file upload is 2 MB, so there should be no problems.

Open php. ini, change upload_max_filesize and post_max_size to 20 MB, and restart.

Upload again. The problem persists. you can solve the php problem.

The default size of the uploaded files in nginx is 1 MB, which can be modified in nginx settings.

The solution is as follows:

1. open the nginx configuration file nginx. conf. The path is usually/etc/nginx. conf.

2. add client_max_body_size 20 m to the http {} segment, and 20 m to the maximum upload size.

3. save and restart nginx to solve the problem.

The above describes how to solve the 413 Request Entity Too Large problem in nginx, including some content, and hope to help friends who are interested in PHP tutorials.

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.