nginx DNS doesn't update the upstream IP

Maxim Dounin mdounin at
Wed Apr 14 20:18:02 UTC 2021


On Wed, Apr 14, 2021 at 01:19:08PM -0400, kay wrote:

> Here is an example of the proxy_pass config, we don't use IP's
> proxy_pass;
> When "" changes the IP address, it is not reflected in nginx.
> We're using k8s pods. Sometime one or two pods have stale DNS cache. Other
> pods work fine...

That's exactly how it is expected to work: names in the 
configuration are resolved during configuration parsing.  If you 
want to re-resolve names, you have to reload the configuration.

Alternatively, you can configure proxy_pass using variables.  As 
documented in

: Parameter value can contain variables. In this case, if an 
: address is specified as a domain name, the name is searched among 
: the described server groups, and, if not found, is determined 
: using a resolver.

Hope this helps.

Maxim Dounin

More information about the nginx mailing list