V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
NGINX
NGINX Trac
3rd Party Modules
Security Advisories
CHANGES
OpenResty
ngx_lua
Tengine
在线学习资源
NGINX 开发从入门到精通
NGINX Modules
ngx_echo
yuyuyu
V2EX  ›  NGINX

如何禁用 proxy_next_upstream_tries 重试?

  •  
  •   yuyuyu · 2017-01-10 17:21:18 +08:00 · 4694 次点击
    这是一个创建于 2656 天前的主题,其中的信息可能已经有所发展或是发生改变。

    Syntax: proxy_next_upstream_tries number; Default: proxy_next_upstream_tries 0; Context: http, server, location This directive appeared in version 1.7.5. Limits the number of possible tries for passing a request to the next server. The 0 value turns off this limitation.

    我不希望 nginx 重试, proxy_next_upstream_tries 不能设置成 0 ,否则就是不停的将请求发到其他的后端服务器,也不能 proxy_next_upstream off ,我还是希望 nginx 能记住这服务器 down 掉了下次请求能发到其他的服务器,好像没办法做到?一定要 proxy_next_upstream_tries 1 重试一次么?

    3 条回复    2017-01-11 08:06:06 +08:00
    Citrus
        1
    Citrus  
       2017-01-10 17:43:47 +08:00
    proxy_next_upstream off 并不代表 Nginx 不会记住这台服务器 Down 了。
    yuyuyu
        2
    yuyuyu  
    OP
       2017-01-10 19:56:31 +08:00 via Android
    @Citrus 我测试过 proxy_next_upstream off 之后故障转移就失效了, max_fails 无效,之后的请求会继续落在 down 掉的机器上
    feijilei
        3
    feijilei  
       2017-01-11 08:06:06 +08:00 via iPhone
    1
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   2859 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 26ms · UTC 11:21 · PVG 19:21 · LAX 04:21 · JFK 07:21
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.