NGINX open-sourced dynamic DNS resolution one year ago.
However, it looks like lua-upstream-nginx-module is not compatible with this.
When adding resolve (and specifying the zone directive) in an upstream block, calling get_primary_peers results in this error:
lua entry thread aborted: runtime error: string length overflow#012stack traceback:#012coroutine 0:#012#011[C]: in function 'get_primary_peers'#012#011/usr/share/lua/5.1/resty/upstream/healthcheck.lua:845: in function 'status_page'
Example conf:
upstream my_backend {
zone zone_my_backend 256k;
server some_server:80 resolve;
keepalive 128;
}
local hc = require("resty.upstream.healthcheck")
ngx.print(hc.status_page())
I may add that some_server returns 24 different IPs (12 IPv4 and 12 IPv6). Maybe it's too much ? Anyway, it should not crash that way.