proxy pass

Cliff Wells cliff at develix.com
Thu Nov 29 21:49:09 MSK 2007


On Thu, 2007-11-29 at 09:22 +0300, Igor Sysoev wrote:
> On Wed, Nov 28, 2007 at 04:55:25PM -0800, Eire Angel wrote:

> The proxy_pass supports variables, for example:
> 
>      proxy_pass  http://$host$uri;
> 
> and the the host part will be resolved on the fly.


Upgraded to Nginx 0.6.20.


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"


Is "map" not yet supported for proxy_pass or am I just doing it wrong?

Regards,
Cliff






More information about the nginx mailing list