[PATCH]upstream server directive support variable

flygoast flygoast at 126.com
Sun Jun 2 12:46:33 UTC 2013

Thanks for your response.

I've tried to dynamicly find upstream block name. However, now my backend ips are stored in some storage like REDIS, or memcache. In each request, I first to get the ips from the storage, then proxy the request to the backend. Some backends have not only one ip, so I used the usptream to process the innormal situation like 502 in someone of them.  Main objective is to retry another backend ip instead of load balance.  

Sorry for my english.

At 2013-06-02 19:33:34,"Maxim Dounin" <mdounin at mdounin.ru> wrote:
>On Sun, Jun 02, 2013 at 09:34:58AM +0800, flygoast wrote:
>> Hi, guys
>> In my business, I need dynamicly  to find the backend ip address 
>> according to the request. However, I also want to use the 
>> upstream to take advantage of load balance. So I add the 
>> variable support in server directive. For sake of avoiding 
>> blocking the whole worker due to resolving domain, at present, 
>> only dotted decimal  IP address should be parsed in
>> the variables. Anyone can help to check or improve it? Thanks. 
>Load balancing requires a state for a group of servers to be kept 
>between requests.  This somewhat contradicts an idea of 
>dynamically finding a backend's ip address for each request - 
>instead of balancing backends the code will balance backend 
>Have you tried dynamically finding an upstream{} block name 
>instead, and configuring appropriate upstream{} blocks?  This is 
>available out of the box.
>Maxim Dounin
>nginx-devel mailing list
>nginx-devel at nginx.org
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.nginx.org/pipermail/nginx-devel/attachments/20130602/23490045/attachment.html>

More information about the nginx-devel mailing list