ngx_lua now has (basic) subrequest support

agentzh agentzh at
Thu Jun 24 14:23:19 MSD 2010

2010/6/24 Peter Leonov <gojpeg at>:
> One more thing. AFAIK, location.capture uses a co-routine to emulate sync
> interface to async subrequest. This is awesome :)

Yup :)

Lua's coroutine is rather light-weight, and luajit's is even lighter ;)

> And what about parallel sub-requests as SSI module does?

It'll be done via the ngx.location.capture_multi interface. It's a TODO ;)

And there will an ngx.subrequest interface that can do subrequests
other than GET ;)

> It gonna be cool to
> see Lua as an SSI mini-language replacement (PHP did you say?).

To be honest, I'm not a big fan of SSI due to its weakness ;)


More information about the nginx-devel mailing list