upstream/302

洪志道 hongzhidao at gmail.com
Wed May 18 07:20:23 UTC 2016


Thank you

But it seems not the solution I really want. The selected peer/server is
calculated by config in upstream, such as 'hash $url consistent'.

2016-05-18 14:07 GMT+08:00 Hung Nguyen <hungnv at opensource.com.vn>:

> Hello,
>
> I do not not think nginx has this feature, but we can do it with lua
> module, at it’s exactly what I did, you can find it here:
> https://github.com/whatvn/nginx_redirect_balancer
>
> *I**t works with help of following awesome module by agentzh: *lua-nginx-module
> and lua-updstream-module
>
>
> -
> Hung
>
>
> From: nginx-devel <nginx-devel-bounces at nginx.org> on behalf of 洪志道 <
> hongzhidao at gmail.com>
> Reply-To: <nginx-devel at nginx.org>
> Date: Wednesday, May 18, 2016 at 12:35 PM
> To: <nginx-devel at nginx.org>
> Subject: upstream/302
>
> Hi
>
> Is there a way to get selected peer in upstream without sending request to
> backend server?
>
> upstream backend {
>     hash $url consistent;
>     server  192.168.1.101;
>     server  192.168.1.102; # Assume this is selected
>     server  192.168.1.103;
> }
>
>
> location /302 {
>    proxy_pass  http://backend;
>    # need other config or develop custom module?
> }
>
>
> > curl http://test.com/302 -v
> ...
> Location: http://192.168.1.102/xxx
> ...
>
> Just get selected server, and immediately return for 302 location.
> Is it possible to support the feature, or give me advices, thanks so much.
> _______________________________________________ nginx-devel mailing list
> nginx-devel at nginx.org
> http://mailman.nginx.org/mailman/listinfo/nginx-devel
>
> _______________________________________________
> nginx-devel mailing list
> nginx-devel at nginx.org
> http://mailman.nginx.org/mailman/listinfo/nginx-devel
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.nginx.org/pipermail/nginx-devel/attachments/20160518/d9ac37db/attachment.html>


More information about the nginx-devel mailing list