13 messages in ru.sysoev.nginxRe: proxy pass
FromSent OnAttachments
Igor SysoevNov 28, 2007 11:17 am 
Eire AngelNov 28, 2007 4:55 pm 
Igor SysoevNov 28, 2007 10:22 pm 
Cliff WellsNov 29, 2007 10:48 am 
Igor SysoevNov 29, 2007 11:05 am 
Cliff WellsNov 29, 2007 11:39 am 
Cliff WellsNov 29, 2007 6:41 pm 
Igor SysoevNov 29, 2007 10:50 pm 
Igor SysoevNov 29, 2007 10:53 pm 
Igor SysoevNov 30, 2007 12:25 am 
Igor SysoevNov 30, 2007 6:46 am 
Cliff WellsNov 30, 2007 2:11 pm 
Igor SysoevNov 30, 2007 2:20 pm 
Actions with this message:
Paste this link in email or IM:
Paste this link in email or IM:
Atom feed for this thread
Paste this URL into your reader:
Subject:Re: proxy passActions...
From:Cliff Wells (clif@public.gmane.org)
Date:Nov 29, 2007 11:39:25 am
List:ru.sysoev.nginx

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