Hello!
On Wed, Oct 7, 2015 at 8:45 PM, <sun...@shieldsquare.com> wrote:
> --nginx.conf
> location / {
> access_by_lua_file ./lua/test.lua; # redirection to some url
>
> # further nginx server logic and render some pages
> echo "Hello Openresty.";
> proxy_pass http://some_url;
Mistake #1: echo and proxy_pass cannot be used in a single location
since only one content handler (or content generator) is allowed in a
single location, for obvious reasons, so only one of them takes
effect.
> -- test.lua
> return ngx.redirect("http://127.0.0.1:5000/cap");
>
> This is redirecting it to my app server page where some captcha page will be
> shown. once it solved successfully solved return me back the response. But i
> somehow wanted to to come back to original request flow after redirection
> success, can it is possible inside lua boundary.
Mistake #2: you have to resume the workflow yourself via request
parameters or cookies since this must go across the Lua boundary (and
also machine boundary) since you're doing two separate HTTP requests
and two separate network round trips here.
Regards,
-agentzh