Welcome! Log In Create A New Profile

Advanced

Re: resolver does not re-resolve upstream servers after initial cache

Dave Nolan
November 08, 2012 05:42AM
Ruslan Ermilov wrote in post #1083512:
> On Wed, Nov 07, 2012 at 09:40:49PM +0100, Dave Nolan wrote:
>> server {
>> As I understand it, without the resolver config, nginx will resolve
>> example.com's IP once on load and cache it until it stops or fully
>> reloads the config.
>>
>> With the resolver config above, nginx should re-resolve the IP every
>> 5mins.
>
> This is not the way how it works.
>
> A run-time resolving only takes place if URL specified in "proxy_pass"
> contains variables, AND the resulting server name doesn't match any of
> the configured server groups (using the "upstream" directives). This
> is documented here: http://nginx.org/r/proxy_pass
>
> In your case, the server name is always "myupstream" and since it
> matches "upstream myupstream", no run-time resolving takes place.

What's the reason behind this? It feels like that, even if proxy_pass
defers to the server group, resolver config should be respected for
servers defined within the group.

>
>> However, this is not happening: I can watch tcpdump -n udp port 53 but I
>> see no re-resolution taking place.
>>
>> I'd love to know how to fix this. Any advice appreciated thanks!
>
> proxy_pass http://example.com$request_uri;
>
> will resolve "example.com" dynamically (assuming of course there's
> no "upstream example.com" in configuration).

Thanks very much for your help.

If I switch to using example.com directly in the proxy_pass, I lose the
flexibility of server groups. Is there any way of dynamically
re-resolving servers in upstream server group?

--
Posted via http://www.ruby-forum.com/.

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

resolver does not re-resolve upstream servers after initial cache

Dave Nolan November 07, 2012 03:42PM

Re: resolver does not re-resolve upstream servers after initial cache

Ruslan Ermilov November 08, 2012 02:36AM

Re: resolver does not re-resolve upstream servers after initial cache

Dave Nolan November 08, 2012 05:42AM

Re: resolver does not re-resolve upstream servers after initial cache

guilhem November 08, 2012 06:07AM

Re: resolver does not re-resolve upstream servers after initial cache

Sergey Budnevitch November 08, 2012 07:06AM

Re: resolver does not re-resolve upstream servers after initial cache

Dave Nolan November 09, 2012 04:16AM

Re: resolver does not re-resolve upstream servers after initial cache

nginxorg November 09, 2012 04:24AM

Re: resolver does not re-resolve upstream servers after initial cache

Sergey K. June 04, 2013 11:28AM

Re: resolver does not re-resolve upstream servers after initial cache

nginxorg November 09, 2012 04:26AM

Re: resolver does not re-resolve upstream servers after initial cache

Miroslav S. January 07, 2015 11:14PM

Re: resolver does not re-resolve upstream servers after initial cache

Maxim Dounin January 12, 2015 07:30AM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 295
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready