Hello!
On Tue, Sep 24, 2013 at 6:37 PM, Payne Chu wrote:
> Thanks Agentzh,
>
Don't capitalize my nick please.
> Do you have any lua sample to show how ngx.location.capture + proxy_pass
> work?
>
Just configure a location with ngx_proxy, and in another location,
initiate a subrequest via the ngx.location.capture().
You can find a lot of examples in ngx_lua's (declarative) test suite,
especially in the following test file:
https://github.com/chaoslawful/lua-nginx-module/blob/master/t/020-subrequest.t#L25
>
> it use $_uri to pass to proxy_pass. will it have any race condition issue?
>
Every Nginx request has its own Nginx variable copy. No race condition
is possible here. You can check out my Nginx tutorials (still under
work!) here for more details:
http://openresty.org/download/agentzh-nginx-tutorials-en.html
You can also find a lot of simple code examples there.
Best regards,
-agentzh