proxy pass

Cliff Wells cliff at develix.com
Thu Nov 29 22:39:48 MSK 2007


On Thu, 2007-11-29 at 22:06 +0300, Igor Sysoev wrote:
> On Thu, Nov 29, 2007 at 10:49:09AM -0800, Cliff Wells wrote:
> 
> > I tried once again to use:
> > 
> > http {
> >     map $host $backend {
> >         hostnames;
> >         .cellarstella.com 127.0.0.6:8000;
> >     }
> > 
> > 
> >     server {
> >         server_name cellarstella.com www.cellarstella.com;
> > 
> >         location / {
> >                 # proxy_pass http://127.0.0.6:8000; # this works
> >                 proxy_pass http://$backend;
> >                 include /etc/nginx/proxy.conf;
> >         }
> >     }
> > 
> > }
> > 
> > 
> > But I get this in the error log:
> > 
> > 
> > 2007/11/29 10:35:52 [error] 2698#0: *28 no resolver defined to
> resolve 127.0.0.6, client: 67.189.89.59, server: www.cellarstella.com,
> request: "GET / HTTP/1.1", host: "www.cellarstella.com"

> Second, after proxy_pass has parsed string it tries to resolve a host in
> following order:
> 
> 1) search all described upstreams,
> 2) try external resolver (named/bind/etc); you should define it
>    in http, server, or location section:
> 
>        resolver 127.0.0.1;
> 
>    however, if the host is an ip address, then nginx does not send DNS
>    query to the resolver, but use the ip address.


Indeed this fixed it.  However, what's not clear to me is why Nginx
tries to resolve 127.0.0.6 since it is an IP address.

Cliff







More information about the nginx mailing list