nginx转发请求超时_nginx设置地址转发
2023-06-13 09:14:28 时间
修改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会关闭连接
版权声明:本文内容由互联网用户自发贡献,该文观点仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 举报,一经查实,本站将立刻删除。
发布者:全栈程序员栈长,转载请注明出处:https://javaforall.cn/180530.html原文链接:https://javaforall.cn
相关文章
- 一次nginx返回422状态码的经历
- Moleft 专用函数库 (四) - 获取网址重定向之后地址
- Tomcat国内镜像下载地址【速度超快】
- linux ntp时钟服务器地址_Linux时间同步+国内常用的NTP服务器地址【NTP时间同步服务器】…
- Nginx配置文件(nginx.conf)配置详解
- Nginx配置文件(nginx.conf)配置详解
- 如何自定义类加载器_网易js加载器下载地址
- Adobe 2023 全家桶正式发布下载地址,这些功能真不错!
- 常见免费邮箱 SMTP 服务地址及端口「建议收藏」
- 零售商贩mysql表设计:收货地址表 用户表(关联起来)
- Nginx - 深入理解nginx的处理请求、进程关系和配置文件重载
- git 修改远程仓库地址详解程序员
- MySQL与Nginx实现高性能的网络连接(mysql连接nginx)
- 使用Nginx命令管理Linux服务器(nginx命令linux)
- Linux中如何快速删除Nginx(linux删除nginx)
- Linux下Nginx实现快速高效的网络服务(linux的nginx)
- 配置Linux下删除Nginx配置的步骤(linux删除nginx)
- 地址管理Oracle数据库的IP地址限制(oracle数据库ip)
- 《Nginx官方文档》如何安装nginx
- 查询Redis服务器的连接地址(查询redis的链接地址)
- 使用Redis实现外网地址配置指南(redis配置外网地址)
- 用C#获取硬盘序列号,CPU序列号,网卡MAC地址的源码
- 如何批量替换相对地址为绝对地址(利用bat批处理实现)
- php页码形式分页函数支持静态化地址及ajax分页