admin管理员组文章数量:1531257
2024年7月3日发(作者:)
nginx常用的超时配置说明
client_header_timeout
语法 client_header_timeout time
默认值 60s
上下文 http server
说明 指定等待client发送一个请求头的超时时间(例如:GET / HTTP/1.1).仅当在
一次read中,没有收到请求头,才会算成超时。如果在超时时间内,client没发送任何东
西,nginx返回HTTP状态码408(“Request timed out”)
client_body_timeout
语法 client_body_timeout time
默认值 60s
上下文 http server location
说明 该指令设置请求体(request body)的读超时时间。仅当在一次readstep中,
没有得到请求体,就会设为超时。超时后,nginx返回HTTP状态码408(“Request timed
out”)
keepalive_timeout
语法 keepalive_timeout timeout [ header_timeout ]
默认值 75s
上下文 http server location
说明 第一个参数指定了与client的keep-alive连接超时时间。服务器将会在这个时
间后关闭连接。可选的第二个参数指定了在响应头Keep-Alive: timeout=time中的time
值。这个头能够让一些浏览器主动关闭连接,这样服务器就不必要去关闭连接了。没有这
个参数,nginx不会发送Keep-Alive响应头(尽管并不是由这个头来决定连接是否
“keep-alive”)
两个参数的值可并不相同
注意不同浏览器怎么处理“keep-alive”头 MSIE和Opera忽略掉"Keep-Alive:
timeout=
持长连接 Mozilla keeps the connection alive for N plus about 1-10 seconds.
Konqueror保持长连接N秒
lingering_timeout
语法 lingering_timeout time
默认值 5s
版权声明:本文标题:Nginx常用超时配置 内容由热心网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:https://m.elefans.com/xitong/1719982029a814437.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论