HttpLuaModule create asynchronous subrequests
Yichun Zhang (agentzh)
agentzh at gmail.com
Thu Nov 13 20:24:53 UTC 2014
On Wed, Nov 12, 2014 at 12:20 PM, Guido Accardo wrote:
> Here, prod response is sent immediately as I want and dev receives the
> traffic but the connection is closed the I got a Broken Pipe (which makes
For this error, maybe you should configure
for your dev location with proxy_pass.
But using ngx.eof() for this will still introduce extra delay for the
subsequent requests on the current downstream connection when HTTP
keepalive or HTTP pipelining is enabled.
> Is there a way to do capture calls in a asynchronous mode or to achieve this
> in other way?
The recommended way is to use cosocket-based http library like Brian
Akins's lua-resty-http-simple  (instead of subrequests and
ngx_proxy) in a 0-delay timer created by ngx.timer.at()  (instead
of the ngx.eof hack).
BTW, it's recommended to join the openresty-en mailing list  for
such ngx_lua related questions that way you may get more responses and
get responses sooner.
For your very use case, maybe lower level tools like tcpcopy  is a
better fit? Not sure though :)
More information about the nginx