upyun / lua-resty-checkups

Manage Nginx upstreams in pure Lua.
259 stars 65 forks source link

您好,这个能支持动态新增或删除upstream指令块吗?就是不需要在nginx.conf里面加 #41

Open codjust opened 5 years ago

codjust commented 5 years ago
 upstream backend {
        server 0.0.0.0;
        balancer_by_lua_block {
            require "wario.balancer"
        }
    }

如上面的代码块,lua-resty-checkups提供的update和delete好像都是预先需要在nginx.conf里面声明了一个backend,才能去动态变更后段的servers,能不能连这个指令也能通过lua来创建呢?

因为我试过lua-resty-checkups的api是做不到的,不知道是不是姿势不对,希望能得到回复,谢谢

strongit commented 5 years ago

同求

huangnauh commented 5 years ago

update_upstream 可以更新一个没有在 nginx.conf 中配置的 upstream,然后可以在如上所示的 wario.balancer 中通过 select_peer 来选择更新的 upstream

strongit commented 5 years ago

https://github.com/yzprofile/ngx_http_dyups_module 这个比较6,但是好像不支持tcp upstream dynamic change and active health check