Can Nginx resolves upstream server name given as SRV DNS records?
I just want to know if Nginx is ab开发者_如何学运维le to resolve SRV DNS records when given as the upstream server address. It seems like it's not the case, but maybe there is a workaround if it can't do this out-of-the-box. Thx in advance.
Free nginx does not support SRV records.
resolve
and service
keywords for upstream directive are not available in free nginx.
There are some free solutions available,
- ngx_upstream_resolveMK
- srv-router
SRV records are not meant to be used like A(ddress) records. In theory it should be possible to hack nginx to resolve SRV records as well but the only advantage I could see is the 'weight' and 'priority' fields used in SRV records.
You can already use this feature in nginx config:
upstream backend {
server backend1.example.com weight=5;
server backend2.example.com:8080;
server unix:/tmp/backend3;
}
HttpUpstreamModule
精彩评论