nginx中請求大小的限制的設置


Nginx對客戶端請求緩沖區大小有個默認限制,如果超過了該值(比如在上傳大文件時),會報500錯誤。

只需要設置三個值,就可以解決該問題:

1、 client_body_buffer_size: 指定客戶端請求體緩沖區大小,如果請求大於該值,會報“500 Internal Server Error”錯誤。

The directive specifies the client request body buffer size.

If the request body is more than the buffer, then the entire request body or some part is written in a temporary file.

The default size is equal to two pages size, depending on platform it is either 8K or 16K.

2、 client_body_temp_path: 指定請求體臨時文件的存放目錄。

The directive assigns the directory for storing the temporary files in it with the body of the request.

3、 client_max_body_size: 允許客戶端請求的最大單文件字節數,如果請求體大於該值,會報“413 Request Entity Too Large”錯誤。

Directive assigns the maximum accepted body size of client request.


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM