Welcome! Log In Create A New Profile

Advanced

Re: Does Nginx honor DNS TTLs for proxy upstreams?

Maxim Dounin
September 26, 2011 05:38AM
Hello!

On Mon, Sep 26, 2011 at 04:42:07AM -0400, csg wrote:

> I have a short question on Nginx's proxy module. In our setup we reverse
> proxy specific requests to the server of an external partner via
> proxy_pass. Over the weekend the partner updated DNS but Nginx wasn't
> catching up the change and still sent traffic to the old server despite
> the fact the TTL of the record was little enough.
>
> An additional obstacle might be that in our case we have for example
>
> proxy_pass http://foo.example.com;
>
> where foo.example.com is a CNAME to bar.example.com (TTL of 1 hour)
> which is a A record (TTL of 60 seconds).
>
> Does Nginx honor DNS changes for upstream proxies or are lookups only
> done once on startup? If not, will the TTL being honor even if it has to
> traverse a list of CNAME records until it hits an A record?

No, domain names statically configured in config are only looked
up once on startup (or configuration reload).

> Both configuration directives, resolver and resolver_timeout are not
> set, therefore the default of 30 seconds should apply (if that is
> relevant here).

These are not relevant for "proxy_pass http://foo.example.com;".
Resolver is only used for proxy_pass with variables, i.e.
something like

resolver 127.0.0.1;
set $backend "foo.example.com";
proxy_pass http://$backend;

In such setup ip address of "foo.example.com" will be looked up
dynamically and result will be cached for 5 minutes.

Maxim Dounin

_______________________________________________
nginx mailing list
nginx@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx
Subject Author Posted

Does Nginx honor DNS TTLs for proxy upstreams?

csg September 26, 2011 04:42AM

Re: Does Nginx honor DNS TTLs for proxy upstreams?

Maxim Dounin September 26, 2011 05:38AM

Re: Does Nginx honor DNS TTLs for proxy upstreams?

csg September 26, 2011 09:40AM

Re: Does Nginx honor DNS TTLs for proxy upstreams?

Maxim Dounin September 26, 2011 09:58AM

Re: Does Nginx honor DNS TTLs for proxy upstreams?

csg September 28, 2011 12:05PM

Re: Does Nginx honor DNS TTLs for proxy upstreams?

Maxim Dounin September 28, 2011 12:14PM

Re: Does Nginx honor DNS TTLs for proxy upstreams?

csg September 28, 2011 03:35PM

Re: Does Nginx honor DNS TTLs for proxy upstreams?

csg September 29, 2011 03:31AM

Re: Does Nginx honor DNS TTLs for proxy upstreams?

csg September 29, 2011 03:32AM

Re: Does Nginx honor DNS TTLs for proxy upstreams?

csg September 29, 2011 03:53AM

Re: Does Nginx honor DNS TTLs for proxy upstreams?

Maxim Dounin September 29, 2011 03:30AM

Re: Does Nginx honor DNS TTLs for proxy upstreams?

csg October 04, 2011 04:12AM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 196
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 500 on July 15, 2024
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready