ngx_lua + proxy_next_upstream

Jedrzej Nowak pigmej at gmail.com
Mon Sep 23 07:16:19 UTC 2013


Hey,

Thanks for your reply. Is there any good "example" of thing what I want to
archive ?

Shall I create something like:

location @blah {

   # here the "normal" configuration for LB

}


location / {

   # here the LUA logic

   # probably with share_all_vars=true

   # subrequest to @blah

}


Is something like that recommended or how should it be done ?

Pozdrawiam
Jędrzej Nowak


On Fri, Sep 20, 2013 at 2:34 AM, Yichun Zhang (agentzh)
<agentzh at gmail.com>wrote:

> Hello!
>
> On Wed, Sep 18, 2013 at 6:09 AM, Jedrzej Nowak wrote:
> > The question is how can I archive proxy_next_upstream.
> > Preferably I would like to return to lua with a error reason.
> > If the only way is to return several servers in upstream from lua, how
> to do
> > so ?
> >
>
> If you want to return the control back to Lua and let your Lua code do
> the upstream retries or something, then you should use the
> ngx.location.capture() API instead to initiate an Nginx subrequest to
> ngx_proxy:
>
>     http://wiki.nginx.org/HttpLuaModule#ngx.location.capture
>
> Regards,
> -agentzh
>
> _______________________________________________
> nginx mailing list
> nginx at nginx.org
> http://mailman.nginx.org/mailman/listinfo/nginx
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.nginx.org/pipermail/nginx/attachments/20130923/df50cfa9/attachment.html>


More information about the nginx mailing list