Help on designing using multiple location/upstream modules

Yichun Zhang (agentzh) agentzh at
Wed Nov 27 20:39:15 UTC 2013


On Tue, Nov 26, 2013 at 4:30 AM, Reetesh Ranjan wrote:
> I have thought of the following design, in terms of nginx modules I would
> use:
> 1   My main location module that picks the keywords entered and communicates
> to Redis and Sphinx
> 2   For communicating to Redis I thought of using HttpRedis2Module
> (
> 3   For communicating with Sphinx, I am trying to write a simple C++ client
> or adapt the Sphinx C++ client
> ( or its parts into an
> upstream module.

This looks trivial if you use ngx_lua module as the glue. In
particular you can check out the ngx.location.capture and
ngx.location.capture_multi API functions for captured subrequests:

And probably also the "light thread" API that can work with the
subrequest API above:

When using the Lua API provided by ngx_lua, everything is nonblocking
out of the box :)


More information about the nginx-devel mailing list