Welcome! Log In Create A New Profile

Advanced

Re: DNS resolution of backends

Maxim Dounin
June 06, 2014 08:42AM
Hello!

On Thu, Jun 05, 2014 at 06:20:35PM +0300, Reinis Rozitis wrote:

> >We run a reverse proxy to Amazon S3 service. Sometime Amazon change their
> >IPs and some of them may become unresponsive and render reservse proxy
> >unusuable. Is there options to force nginx to re-resolve IPs of backends
> >lets say each 5 mins ?
>
> Give the upstream{} block the hostnames of the instances and add an resolver
> ( http://nginx.org/en/docs/http/ngx_http_core_module.html#resolver ).

This won't make any difference. Names of servers in upstream{}
blocks are resolved during configuration parsing, and won't be
re-resolved till next configuration parsing.

To ensure periodic hostname resolution, one have to use a
hostname (not an upstream block) in proxy_pass, and variables in
the proxy_pass directive. This way, nginx won't know a hostname
in advance, and will have to use resolver to resolve it, resulting
in a periodic hostname resolution.

(Alternatively, a special "resolve" flag for servers in upstream{}
blocks was recently introduced of the commercial subscription, see
http://nginx.org/en/docs/http/ngx_http_upstream_module.html#server.
But this requires commercial subscription.)

--
Maxim Dounin
http://nginx.org/

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

DNS resolution of backends

MaxDudu June 05, 2014 11:10AM

Re: DNS resolution of backends

Reinis Rozitis June 05, 2014 11:22AM

Re: DNS resolution of backends

MaxDudu June 05, 2014 02:40PM

Re: DNS resolution of backends

Maxim Dounin June 06, 2014 08:42AM

Re: DNS resolution of backends

MaxDudu June 06, 2014 05:16PM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 296
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