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

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

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

(0)
全栈程序员-站长的头像全栈程序员-站长


相关推荐

  • SQL中NVL函数

    SQL中NVL函数空值判断函数1、NVL(表达式A,表达式B)如果表达式A为空值,NVL返回值为表达式B的值,否则返回表达式A的值。该函数的目的是把一个空值(null)转换成一个实际的值。其表达式的值可以是数字型、

    2022年7月4日
    27
  • UVA11294-Wedding(2-SAT)

    UVA11294-Wedding(2-SAT)

    2022年1月4日
    39
  • oracle删除索引并释放空间_oracle日志文件 定期清理

    oracle删除索引并释放空间_oracle日志文件 定期清理1.背景概述近期应用升级上线过程中,存在删除业务表索引的变更操作,且因删除索引导致次日业务高峰时期,数据库响应缓慢的情况,经定位是缺失索引导致。与用户沟通,虽然变更中删除索引的需求很少,但也存在此类需求。本文从数据库层面,旨在尽可能避免类似问题发生,制定删除索引的变更规范。2.索引删除规范若确认需要做索引删除,可以使用Oracle提供的两个功能特性协助判断删除索引是否会有隐患。2.1增加索引监控…

    2025年9月15日
    6
  • aircrack和reaver破解路由器PIN码

    aircrack和reaver破解路由器PIN码使用aircrack,寻找附近开启wps的路由器,邪恶……嘻嘻airmon-ng start wlan0airodump-ng mon0CH 11 ][ Elapsed: 36 s ][ 2012-12-18 04:46                                          BSSID              PWR  Beacons    #Data

    2022年5月5日
    108
  • 每天一个linux命令(43):killall命令

    每天一个linux命令(43):killall命令

    2021年9月16日
    58
  • ETL工具-Kettle Spoon教程

    ETL工具-Kettle Spoon教程一。KettleSpoon简介   ETL(Extract-Transform-Load的缩写,即数据抽取、转换、装载的过程),对于企业或行业应用来说,我们经常会遇到各种数据的处理,转换,迁移,了解并掌握一种etl工具的使用,必不可少,支持图形化的GUI设计界面,然后可以以工作流的形式流转,在做一些简单或复杂的数据抽取、质量检测、数据清洗、数据转换、数据过滤等方面有着比较稳定的表现,使…

    2022年5月23日
    65

发表回复

您的邮箱地址不会被公开。 必填项已用 * 标注

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