nginx转发请求超时_nginx设置地址转发

nginx转发请求超时_nginx设置地址转发修改nginx配置文件/etc/nginx/nginx.conf添加:proxy_connect_timeout300;proxy_send_timeout300;proxy_read_timeout300;keepalive_timeout300;fastcgi_connect_time

大家好,又见面了,我是你们的朋友全栈君。如果您正在找激活码,请点击查看最新教程,关注关注公众号 “全栈程序员社区” 获取激活教程,可能之前旧版本教程已经失效.最新Idea2022.1教程亲测有效,一键激活。

Jetbrains全系列IDE稳定放心使用

修改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会关闭连接

版权声明:本文内容由互联网用户自发贡献,该文观点仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 举报,一经查实,本站将立刻删除。

发布者:全栈程序员-用户IM,转载请注明出处:https://javaforall.cn/180530.html原文链接:https://javaforall.cn

【正版授权,激活自己账号】: Jetbrains全家桶Ide使用,1年售后保障,每天仅需1毛

【官方授权 正版激活】: 官方授权 正版激活 支持Jetbrains家族下所有IDE 使用个人JB账号...

(0)


相关推荐

  • 天涯共此双11——天猫升级港澳台“购物天堂”

    天涯共此双11——天猫升级港澳台“购物天堂”香港北区上水60多年的老字号正和隆酱油没想过会出名。这家专注服务街坊的小店不在乎“酱香巷子深”,门店一半是透明及地的塑胶门帘,一半是一块块拼接起来的黄色纸板箱。来的都是熟客,所谓收银台就是个铅桶,顾客要付钱就把铅桶拉下来,付钱、找零,再把铅桶放上去。这是父辈们持续了半个多世纪的生意。到了店主女儿这里,事情开始改变。她赶时髦,在店里放了有支付宝二维码的蓝白…

  • iOS跑步软件开发-从无到有

    iOS跑步软件开发-从无到有前言经过两个多月的开发与调试,全民星跑1.0.1终于上线了,首先要感谢曲总和洛洛爱吃肉的技术支持.全民星跑作为一个以跑步计步为主要功能的软件,骚栋在开发过程中实在是遇到了不少的坑,这篇博客会分为加速仪计步和跑步计步两个模块来说明,不过有一点我想先声明,因为人力资源有限,所以可能在计步的逻辑上跟不上咕咚或者是Keep这些大厂,望各位看官见谅.????????????功能规划一个App如何统计一个人的运动?这里主要有两种方式,一种是使用陀螺仪(或是加速仪)获取手机各个方向的加速度来统计用户的

  • html 二级菜单

    html 二级菜单先放效果图:首先设置菜单的基本轮廓<divid=”nav”><ul><li><ahref=”#”>一级菜单1</a></li><li><ahref=”#”>一级菜单2</a></li><li>…

  • slic超像素分割算法_hdr算法

    slic超像素分割算法_hdr算法原文出自:https://blog.csdn.net/Fighting_Dreamer/article/details/77170859SLIC与目前最优超像素算法的比较RadhakrishnaAchanta,AppuShaji,KevinSmith,AurelienLucchi,PascalFua,andSabineS¨usstrunk摘要近年来,计算机视觉应用越来越依赖…

    2022年10月28日
  • postgresql 索引类型[通俗易懂]

    postgresql 索引类型[通俗易懂]postgresql提供了B-tree,R-tree,GiST和hash索引类型。不同的索引类型适合特定的查询类型。绝大多数数据库都支持B-tree索引类型,postgresql默认的createindex语句也是创建B-tree索引。 R-tree:R树是一种用于处理多维数据的数据结构,用来访问二维或者更高维区域对象组成的空间数据.R树是一棵平衡树。树上有两类结点:叶子结点和非

  • idea mac激活码_在线激活

    (idea mac激活码)JetBrains旗下有多款编译器工具(如:IntelliJ、WebStorm、PyCharm等)在各编程领域几乎都占据了垄断地位。建立在开源IntelliJ平台之上,过去15年以来,JetBrains一直在不断发展和完善这个平台。这个平台可以针对您的开发工作流进行微调并且能够提供…

发表回复

您的电子邮箱地址不会被公开。

关注全栈程序员社区公众号