Directed Load Balance Help.

David Moffett dmoffett at
Tue Jul 31 21:15:48 MSD 2007

Our project needs to redirect users to certain back end servers based  
on the url.  For example if the url contains a string '00um' that  
should redirect the user to a certain mongrel cluster on a particular  

I have tried to use something like the following:

   upstream mongrel {
         set $server_key = "";
         if( $request_uri ~* "id=^.*([0-9][0-9][a-z][a-z])$" ) {
                 set $server_key $1
         hash $server_key

As you may guess the above configure is a concept and probably does  
not work.  I have tried some variations on this theme with out much  

First question is will something like this work at all or does the  
hash actually just index into the upstream table or is the upstream  
table a hash that can be looked up by key?

Second question is there a method to do what I am asking if the above  
solution is not even close.  :-)

Thank you,

More information about the nginx mailing list