Nginx Upload file 413 error resolution (Request Entity Too Large)

Source: Internet
Author: User

Today in the test colleague in testing the new machine OCR recognition when prompted to upload pictures failed to view Nginx log found the following error:

The reason is because the client upload file size exceeds the Nginx limit (default is 1M) The official explanation is as follows:
Http://nginx.org/en/docs/http/ngx_http_core_module.html#client_max_body_size

Syntax: client_max_body_size size;Default:    client_max_body_size 1m;Context:    http, server, location

The workaround is to add the following configuration (HTTP context in nginx.conf) to the Nginx configuration file:

http {  ...client_max_body_size 8M;  client_body_buffer_size 128k;  ...    }

After the completion of the smooth restart Nginx can

After the completion of the smooth restart Nginx can:

 nginx -t  

Ps:http 413 Status Code
The server refuses to process the current request because the size of the entity data submitted by the request exceeds the scope that the server is willing or able to handle.   In this case, the server can close the connection to prevent the client from continuing to send this request. If this condition is temporary, the server should return a retry-after response header to tell the client how much time it can retry.

Nginx Upload file 413 error resolution (Request Entity Too Large)

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.