<div style="line-height:1.7;color:#000000;font-size:14px;font-family:arial"><div>Thanks for your response.</div><div><br></div>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. <div><br></div><div>Sorry for my english.<br><br><pre>At 2013-06-02 19:33:34,"Maxim Dounin" <mdounin@mdounin.ru> wrote:
>Hello!
>
>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
>"placeholders".
>
>Have you tried dynamically finding an upstream{} block name
>instead, and configuring appropriate upstream{} blocks? This is
>available out of the box.
>
>--
>Maxim Dounin
>http://nginx.org/en/donation.html
>
>_______________________________________________
>nginx-devel mailing list
>nginx-devel@nginx.org
>http://mailman.nginx.org/mailman/listinfo/nginx-devel
</pre></div></div><br><br><span title="neteasefooter"><span id="netease_mail_footer"></span></span>