a nginx module, support dns srv base on tengine ngx_http_upstream_dynamic_module
nginx ngx_resolve_name function query SRV record, if ctx->service not empty.
so ngx_http_upstream_dynamic_module set ctx->service is your domain suffix, ctx->name is servicename.
ctx->service read from upstream config
like that
upstream backend {
dynamic_resolve fallback=stale fail_timeout=30s;
server test1.kns.local;
}
expect config
upstream backend {
dynamic_resolve fallback=stale fail_timeout=30s;
server kns.local test1;
}
DNS SRV query: test1.kns.local
https://github.com/tiny1990/nginx-srv/blob/master/ngx_http_upstream_dynamic_module.c#L512
server name needs endWith kns.local
ctx->name and ctx->serice configable