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