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.
本文作者:韩憨
本文链接:https://www.cnblogs.com/hanby/p/14513112.html
版权声明:本作品采用知识共享署名-非商业性使用-禁止演绎 2.5 中国大陆许可协议进行许可。
【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步