nginx-0.6.18

Cliff Wells cliff at develix.com
Sat Dec 1 01:07:16 MSK 2007


On Fri, 2007-11-30 at 09:44 +0300, Igor Sysoev wrote:
> On Thu, Nov 29, 2007 at 07:52:51PM -0800, Cliff Wells wrote:
> 
> > On Tue, 2007-11-27 at 19:25 +0300, Igor Sysoev wrote:
> > > Changes with nginx 0.6.18                                        27 Nov 2007
> > 
> > >     *) Feature: variables support in the "proxy_pass" directive.
> > 
> > Any chance variable support will make it into fastcgi_pass and upstream
> > directives soon as well?
> 
> fastcgi_pass will support variables.

That will be great.

> How do see you variables in upstream ?

I'm mostly interested in managing a large number of backends (shared
hosting environment) where each client gets an internal IP address
(127.0.0.0).  Using map makes it quite simple to prevent collisions
(assigning same internal IP to two different clients).  

Mostly I am interested in *never* putting an actual IP address in the
server section, only in the map section.


map $host $internal_ip {
    hostnames;
    .host1.com       127.0.0.2;
    .host2.com       127.0.0.3;
    .host3.com       127.0.0.3;
}

upstream cluster {
    $internal_ip:8000;
    $internal_ip:8001;
    $internal_ip:8002;
    $internal_ip:8003;
}

server {
    server_name www.host1.com;
    location / {
        proxy_pass http://cluster;
    }
}

server {
    server_name www.host2.com;
    location / {
        proxy_pass http://cluster;
    }
}

Regards,
Cliff







More information about the nginx mailing list