nginx 转发请求超时
来源:互联网 发布:淘宝汽车超人假机油 编辑:程序博客网 时间:2024/05/20 18:19
修改nginx 配置文件/etc/nginx/nginx.conf
添加:
proxy_connect_timeout 300; proxy_send_timeout 300; proxy_read_timeout 300; keepalive_timeout 300; fastcgi_connect_timeout 6000; fastcgi_send_timeout 6000; fastcgi_read_timeout 6000; fastcgi_buffer_size 256k; fastcgi_buffers 8 256k; fastcgi_busy_buffers_size 256k; fastcgi_temp_file_write_size 256k;
重启nginx服务再次运行 问题解决
proxy转发模块的超时设置:proxy_connect_timeout语法 proxy_connect_timeout time 默认值 60s上下文 http server location说明 该指令设置与upstream server的连接超时时间,有必要记住,这个超时不能超过75秒。这个不是等待后端返回页面的时间,那是由proxy_read_timeout声明的。如果你的upstream服务器起来了,但是hanging住了(例如,没有足够的线程处理请求,所以把你的请求放到请求池里稍后处理),那么这个声明是没有用的,因为与upstream服务器的连接已经建立了。This directive assigns a timeout for the connection to the proxyserver. This is not the time until the server returns the pages, this is the proxy_read_timeout statement. If your proxyserver is up, but hanging (e.g. it does not have enough threads to process your request so it puts you in the pool of connections to deal with later), then this statement will not help as the connection to the server has been made. It is necessary to keep in mind that this time out cannot be more than 75 seconds.proxy_read_timeout语法 proxy_read_timeout time 默认值 60s上下文 http server location说明 该指令设置与代理服务器的读超时时间。它决定了nginx会等待多长时间来获得请求的响应。这个时间不是获得整个response的时间,而是两次reading操作的时间。(??什么是两次reading操作的时间)This directive sets the read timeout for the response of the proxied server. It determines how long NGINX will wait to get the response to a request. The timeout is established not for entire response, but only between two operations of reading.In contrast to proxy_connect_timeout, this timeout will catch a server that puts you in it's connection pool but does not respond to you with anything beyond that. Be careful though not to set this too low, as your proxy server might take a longer time to respond to requests on purpose (e.g. when serving you a report page that takes some time to compute). You are able though to have a different setting per location, which enables you to have a higher proxy_read_timeout for the report page's location.If the proxied server nothing will communicate after this time, then nginx is shut connection.proxy_send_timeout语法 proxy_send_timeout time 默认值 60s上下文 http server location说明 这个指定设置了发送请求给upstream服务器的超时时间。超时设置不是为了整个发送期间,而是在两次write操作期间。如果超时后,upstream没有收到新的数据,nginx会关闭连接
阅读全文
0 0
- nginx 转发请求超时
- nginx超时转发请求问题
- nginx超时转发机制
- nginx请求转发
- Nginx转发请求
- nginx实现请求转发
- nginx实现请求转发
- nginx实现请求转发
- nginx 转发请求 反向代理
- nginx请求转发和重写
- NGINX通过Stream转发ftp请求
- nginx处理post请求之数据转发
- nginx 配置请求转发 和 负载均衡
- Nginx配置端口转发 映射 以及连接超时问题
- nginx 将http请求转发到https请求
- nginx 将http请求转发到https请求
- nginx学习(2):启动gzip、虚拟主机、请求转发、负载均衡
- nginx配置,请求502转发到其它机器处理
- C语言贪心算法之过河问题
- kafka java
- 闰年
- InnoDB的B+树索引
- 使用IDEA2017 支持vue 项目+ es6
- nginx 转发请求超时
- HDFS和MapReduce核心思想
- 40个Java集合面试问题和答案
- java中对象的关系
- 析构函数声明为私有的作用
- 现代操作系统之文件系统(中)
- Oracle中将毫秒类型时间转换以及取到毫秒时间类型的解决办法
- 如何写出优美的C代码
- kafka java demo