or reloads its configuration, it queries a DNS server to resolve backends.example.com. The DNS server returns the list of three backends discussed above, and NGINX uses the default Round Robin algorithm to load balance requests among them. NGINX chooses the DNS server from the OS configuration file /etc/resolv.conf. This method is the least flexible way to do service discovery and has the following additional drawbacks: • If the domain name can’t be resolved, NGINX fails to start or reload its configuration. • NGINX caches the DNS records until the next restart or configuration reload, ignoring the records’ TTL values. • We can’t specify another load-balancing algorithm, nor can we configure passive health checks or other features defined by parameters to the server directive, which we’ll describe in the next section.
or reloads its configuration, it queries a DNS server to resolve backends.example.com. The DNS server returns the list of three backends discussed above, and NGINX uses the default Round Robin algorithm to load balance requests among them. NGINX chooses the DNS server from the OS configuration file /etc/resolv.conf. This method is the least flexible way to do service discovery and has the following additional drawbacks: • If the domain name can’t be resolved, NGINX fails to start or reload its configuration. • NGINX caches the DNS records until the next restart or configuration reload, ignoring the records’ TTL values. • We can’t specify another load-balancing algorithm, nor can we configure passive health checks or other features defined by parameters to the server directive, which we’ll describe in the next section. 再起動やリロードするまでDNSレコードをキャッシュ。TTLは無視。