【问题标题】:How can dynamically create upstream block with Openresty and Lua?如何使用 Openresty 和 Lua 动态创建上游块?
【发布时间】:2021-06-08 02:46:33
【问题描述】:

我需要使用 OpenrestyLuadefault.conf 中动态创建一个upstream 块。

upstream my_gateway{

    for server in #SERVERS_ENV:
       server xxx.xxx.xxx.xx:yyyy  max_fails=3 fail_timeout=30s;
}

【问题讨论】:

    标签: nginx lua nginx-config openresty


    【解决方案1】:

    ngx.balancer 就是你要找的东西。

    【讨论】:

      猜你喜欢
      • 2020-12-20
      • 1970-01-01
      • 2022-11-04
      • 1970-01-01
      • 1970-01-01
      • 2013-11-28
      • 2021-11-13
      • 2020-02-09
      • 1970-01-01
      相关资源
      最近更新 更多