Please excuse a very beginner question.
I'm having trouble understanding the nginx 'resolver' parameter and how it works. I have read the documentation, searched tutorials and posts (using keywords like resolver, nginx, and dns), and I'm still not sure how to apply resolver.
http://nginx.org/en/docs/http/ngx_http_core_module.html#resolver
"Configures name servers used to resolve names of upstream servers into addresses...."
- By this definition, it seems to be simply doing the nameserver's job.
resolver ns1.myhost.com ns2.myhost.com;
But the examples point to an internal/private IP address.
"An address can be specified as a domain name or IP address, and an optional port...."
- This implies that I could
resolver example.com www.example.com;
(orresolver 12.34.56.78;
) but again, I see no such examples in the documentation.
As a practical example, let's say — purely hypothetically :) — that I'm building a simple web server with a couple of server blocks on it.
Do I set 'resolver' to the IP of the server itself? Or an internal IP in the server's LAN? The documentation seems to suggest an internal IP (127.x.x.x or 10.x.x.x) — but how to set/determine what that IP is?