Help on designing using multiple location/upstream modules

Reetesh Ranjan reeteshr at outlook.com
Sat Nov 30 19:05:10 UTC 2013


Hi Yichun Zhang,
Thanks for the help! Going by the documentation of the lua-nginx-module on its subrequest handling it looks really promising for my use case. I am currently writing the Sphinx2 upstream module. Would get back with questions in case I have any on using the lua-nginx-module for achieving what I need to do.
Regards,Reetesh

> Date: Wed, 27 Nov 2013 12:39:15 -0800
> Subject: Re: Help on designing using multiple location/upstream modules
> From: agentzh at gmail.com
> To: nginx-devel at nginx.org
> 
> Hello!
> 
> 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
> > (http://wiki.nginx.org/HttpRedis2Module)
> > 3   For communicating with Sphinx, I am trying to write a simple C++ client
> > or adapt the Sphinx C++ client
> > (http://sourceforge.net/projects/cppsphinxclient/) 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:
> 
> https://github.com/chaoslawful/lua-nginx-module#ngxlocationcapture
> 
> https://github.com/chaoslawful/lua-nginx-module#ngxlocationcapture_multi
> 
> And probably also the "light thread" API that can work with the
> subrequest API above:
> 
> https://github.com/chaoslawful/lua-nginx-module#ngxthreadspawn
> 
> When using the Lua API provided by ngx_lua, everything is nonblocking
> out of the box :)
> 
> Regards,
> -agentzh
> 
> _______________________________________________
> nginx-devel mailing list
> nginx-devel at nginx.org
> http://mailman.nginx.org/mailman/listinfo/nginx-devel
 		 	   		  
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.nginx.org/pipermail/nginx-devel/attachments/20131201/eb6c17ce/attachment.html>


More information about the nginx-devel mailing list