客户度连接nginx超时, 建议5s内

接收客户端header超时, 默认60s, 如果60s内没有收到完整的http包头, 返回408

Syntax: client_header_timeout time;
Default:
client_header_timeout 60s;
Context: http, server
Defines a timeout for reading client request header. If a client does not transmit the entire header within this time,
the (Request Time-out) error is returned to the client.

接收客户端body超时, 默认60s, 如果连续的60s内没有收到客户端的1个字节, 返回408

Syntax: client_body_timeout time;
Default:
client_body_timeout 60s;
Context: http, server, location
Defines a timeout for reading client request body. The timeout is set only for a period between two successive read operations, not for the transmission of the whole request body.
If a client does not transmit anything within this time,
the (Request Time-out) error is returned to the client.

keepalive时间,默认75s,通常keepalive_timeout应该比client_body_timeout大

Syntax: keepalive_timeout timeout [header_timeout];
Default:
keepalive_timeout 75s;
Context: http, server, location
The first parameter sets a timeout during which a keep-alive client connection will stay open on the server side. The zero value disables keep-alive client connections.
The optional second parameter sets a value in the “Keep-Alive: timeout=time” response header field. Two parameters may differ.
The “Keep-Alive: timeout=time” header field is recognized by Mozilla and Konqueror. MSIE closes keep-alive connections by itself in about 60 seconds.

可以理解为TCP连接关闭时的SO_LINGER延时设置,默认5s

Syntax: lingering_timeout time;
Default:
lingering_timeout 5s;
Context: http, server, location
When lingering_close is in effect, this directive specifies the maximum waiting time for more client data to arrive. If data are not received during this time,
the connection is closed. Otherwise, the data are read and ignored, and nginx starts waiting for more data again.
The “wait-read-ignore” cycle is repeated, but no longer than specified by the lingering_time directive.

域名解析超时,默认30s

Syntax: resolver_timeout time;
Default:
resolver_timeout 30s;
Context: http, server, location
Sets a timeout for name resolution, for example: resolver_timeout 5s;

发送数据至客户端超时, 默认60s, 如果连续的60s内客户端没有收到1个字节, 连接关闭

Syntax: send_timeout time;
Default:
send_timeout 60s;
Context: http, server, location
Sets a timeout for transmitting a response to the client. The timeout is set only between two successive write operations,
not for the transmission of the whole response. If the client does not receive anything within this time, the connection is closed.

nginx与upstream server的连接超时时间

Syntax: proxy_connect_timeout time;
Default:
proxy_connect_timeout 60s;
Context: http, server, location
Defines a timeout for establishing a connection with a proxied server. It should be noted that this timeout cannot usually exceed seconds.

nginx接收upstream server数据超时, 默认60s, 如果连续的60s内没有收到1个字节, 连接关闭

Syntax: proxy_read_timeout time;
Default:
proxy_read_timeout 60s;
Context: http, server, location
Defines a timeout for reading a response from the proxied server. The timeout is set only between two successive read operations,
not for the transmission of the whole response. If the proxied server does not transmit anything within this time, the connection is closed.

nginx发送数据至upstream server超时, 默认60s, 如果连续的60s内没有发送1个字节, 连接关闭

Syntax: proxy_send_timeout time;
Default:
proxy_send_timeout 60s;
Context: http, server, location
Sets a timeout for transmitting a request to the proxied server. The timeout is set only between two successive write operations,
not for the transmission of the whole request. If the proxied server does not receive anything.

转自:https://blog.csdn.net/xizaihui/article/details/53306496?utm_source=itdadao&utm_medium=referral

另参考:https://blog.csdn.net/achenyuan/article/details/79122894

nginx常用超时设置的更多相关文章

  1. nginx常用伪静态设置

    nginx里使用伪静态是直接在nginx.conf 中写规则的,并不需要像apache要开启写模块(mod_rewrite)才能进行伪静态. nginx只需要打开nginx.conf配置文件,在ser ...

  2. flask nginx+uwsgi超时设置

    最近使用uwsgi+nginx经常程序执行一般就跳转到nginx报错页面,查看停止时程序日志还在写,nginx报错upstream timeout排查怀疑是超时的问题 设置nginx uwsgi_co ...

  3. nginx常用参数设置

    1)隐藏nginx header 版本号 使用curl -I http://www.10.0.3.46 会发现server那里显示版本号 在nginx.conf的http里添加参数server_tok ...

  4. nginx中的超时设置,请求超时、响应等待超时等

    nginx比较强大,可以针对单个域名请求做出单个连接超时的配置. 比如些动态解释和静态解释可以根据业务的需求配置 proxy_connect_timeout :后端服务器连接的超时时间_发起握手等候响 ...

  5. nginx的重试机制以及nginx常用的超时配置说明

    nginx的重试机制 现在对外服务的网站,很少只使用一个服务节点,而是部署多台服务器,上层通过一定机制保证容错和负载均衡. nginx就是常用的一种HTTP和反向代理服务器,支持容错和负载均衡. ng ...

  6. nginx中的超时设置

    nginx使用proxy模块时,默认的读取超时时间是60s. 1. send_timeout syntax: send_timeout the time default: send_timeout 6 ...

  7. nginx常用的超时配置说明

    client_header_timeout 语法 client_header_timeout time默认值 60s上下文 http server说明 指定等待client发送一个请求头的超时时间(例 ...

  8. Python脚本控制的WebDriver 常用操作 <二十八> 超时设置和cookie操作

    超时设置 测试用例场景 webdriver中可以设置很多的超时时间 implicit_wait.识别对象时的超时时间.过了这个时间如果对象还没找到的话就会抛出异常 Python脚本 ff = webd ...

  9. Nginx常用配置实例(4)

    Nginx作为一个HTTP服务器,在功能实现方面和性能方面都表现得非常卓越,完全可以与Apache相媲美,几乎可以实现Apache的所有功能,下面就介绍一些Nginx常用的配置实例,具体包含虚拟主机配 ...

随机推荐

  1. go语言之进阶篇方法的继承

    1.方法的继承 示例: package main import "fmt" type Person struct { name string //名字 sex byte //性别, ...

  2. [leetcode]Permutations @ Python

    原题地址:https://oj.leetcode.com/problems/permutations/ 题意: Given a collection of numbers, return all po ...

  3. 服务器主机上RAID Controller的Read Ahead Policy

    RAID控制器(卡)会根据Read Ahead Policy 来决定是否只读取应用程序所请求的一块数据, 还是从硬盘上读取整个stripe. 这个policy会对读的性能产生影响. No Read A ...

  4. iOS开发-16进制颜色转换

    项目中经常会用到颜色转换,有的是通过十六进制转成数字转颜色,想简单的点直接通过字符串转一下,简单扩展了一下分类UIColor,代码如下: +(UIColor *)colorWithHex:(NSStr ...

  5. 【Scala】Scala-None-null引发的血案

    Scala-None-null引发的血案 Overview - Spark 2.2.0 Documentation Spark Streaming - Spark 2.2.0 Documentatio ...

  6. Topic Model的分类和设计原则

    Topic Model的分类和设计原则 http://blog.csdn.net/xianlingmao/article/details/7065318 topic model的介绍性文章已经很多,在 ...

  7. 本地时间转化成 GMT 时间

    DateTime.Now.ToUniversalTime().ToString("yyMMddHHmmss");

  8. 【收藏】介绍RCU的好文章

    RCU原理: RCU(Read-Copy Update),顾名思义就是读-拷贝修改,它是基于其原理命名的.对于被RCU保护的共享数据结构,读者不需要获得任何锁就可以访问它,但写者在访问它时首先拷贝一个 ...

  9. Eclipse CDT 插件列表

    http://www.bestplugins.com/software/eclipse-c-plugin.html

  10. 给ajax表单提交数据前面加上实体名称

    有时候我们后台做了一个引用类型例如: 下面的实体以C#为例 public class Order{ public string orderId{get;set;} public OrderItem o ...