Using Nginx as a reverse proxy, there is a strange problem, small files can be submitted, large files will be reported 500 internal error. What is the cause of this?
The wiki shows that there are three configurations associated with the upload file size
Client_body_buffer_size configuration request body buffer size, not worthy of words,
Client_body_temp_path set 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 setting the maximum value of the uploaded file
So to find out, the problem arises because
1. File size exceeds Client_body_buffer_size
2.client_body_temp_path temporary file path does not have write permission
The two reasons above cause a 500 error to be returned.
If the upload file size exceeds client_max_body_size, the 413 entity too large error is reported.
The reason is known, the correction is simple.
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 permission, this is a clear error. Just fix it, okay?
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.
Can be set to client_max_body_size 100m; or set this value according to your own business.
Nginx Upload File size