Nginx Reverse proxy attachment upload

Source: Internet
Author: User
Tags temporary file storage nginx reverse proxy

Some time ago the company test colleagues said upload attachment is too big upload failed, yesterday a person to work overtime, calm down, slowly smoothed over, the process is like this, but also treat the official listen to my slow way:

and Nginx upload the file has a total of three parameters, namely:client_body_buffer_size,client_body_temp_path,Client_ Max_body_size, let's introduce the difference and usage of these three parameters.


client_ Body_buffer_size :  Configure the request body buffer size, if the directive is annotated, use the default client_body_buffer_size settings, which is twice times the size of the operating system page, 8k or 16k.

Client_body_temp_path: Sets the temporary file storage path. Only when the requested body of the upload exceeds the buffer size will it be written to the temporary file

Client_max_body_size: Set the maximum value of the uploaded file


elaborated

1. When the upload file size exceeds the size of the Client_body_buffer_size setting, then the upload file will be temporarily written to the Client_body_temp_path directory, if there is no write permission then play eggs, the report 500 error.

2. When the upload file exceeds the size of the client_body_buffer_size setting and also exceeds the size of the client_max_body_size setting, 413 errors are reported.

Summarize:

1.client_body_buffer_size try to set the large point, which is based on the speed of consideration, if because the settings are too small, resulting in the upload of the file old to write disk, that speed is too slow.

2.client_body_temp_path path to have writable permissions.

3.client_max_body_size set the maximum value of the uploaded file, this is based on security considerations, we believe that normal users will not or basically not upload too large files.



This article is from the "Learning to change the Destiny" blog, please make sure to keep this source http://xinsir.blog.51cto.com/5038915/1970273

Nginx Reverse proxy attachment upload

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.