Welcome! Log In Create A New Profile

Advanced

Re: how to disable nginx internal dns cache?

Maxim Dounin
May 06, 2013 10:00AM
Hello!

On Mon, May 06, 2013 at 09:31:14AM -0400, nevernet wrote:

> i have resolver define, see below configuration:
>
> server {
> listen 80;
> server_name xx.com;
> access_log /var/log/nginx/xx-nginx.access.log;
> error_log /var/log/nginx/xx-nginx_error.log debug;
>
> # resolver 8.8.8.8;
> # resolver_timeout 1s;
>
> #set your default location
> location / {
> # resolver 8.8.8.8 valid=5s; # i have defined resolver at here ,and also
> tried to add it in "http" section in nginx.conf file. but both of them
> doesnt work.
> proxy_pass http://p2.domain.com;
> }

Resolver directive is only used if you use variables in
proxy_pass. Use something like this to force resolver usage:

location / {
set $backend "p2.domain.com";
proxy_pass http://$backend;
}

By default nginx resolvers hostnames to ip addresses while loading
configuration, and will not re-resolve them unless you'll reload
configuration (see http://nginx.org/en/docs/control.html).

--
Maxim Dounin
http://nginx.org/en/donation.html

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

how to disable nginx internal dns cache?

nevernet May 04, 2013 08:42AM

Re: how to disable nginx internal dns cache?

Francis Daly May 04, 2013 09:06AM

Re: how to disable nginx internal dns cache?

nevernet May 06, 2013 09:31AM

RE: how to disable nginx internal dns cache?

Lukas Tribus May 06, 2013 09:54AM

Re: how to disable nginx internal dns cache?

Maxim Dounin May 06, 2013 10:00AM

Re: how to disable nginx internal dns cache?

nevernet May 07, 2013 04:51AM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

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