<html>
<head>
<style><!--
.hmmessage P
{
margin:0px;
padding:0px
}
body.hmmessage
{
font-size: 12pt;
font-family:Calibri
}
--></style></head>
<body class='hmmessage'><div dir='ltr'>Hi,<div><br></div><div>I am a newbie to nginx. I have done some initial research on nginx architecture, location modules, upstream modules, third party modules available for various purposes etc. After going through a number of pages I have a question which I can't seem to find an easy answer to.</div><div><br></div><div>I have a very simple use case like this: user enters a set of keywords to search on my web site. In the backend, in my nginx location module, i first go to Redis for cached results against the set of keywords and if not found, to Sphinx search daemon. In the latter case, I set the results obtained from Sphinx back into Redis.</div><div><br></div><div>I have thought of the following design, in terms of nginx modules I would use:</div><div><br></div><div>1   My main location module that picks the keywords entered and communicates to Redis and Sphinx</div><div>2   For communicating to Redis I thought of using HttpRedis2Module (<a href="http://wiki.nginx.org/HttpRedis2Module" target="_blank" style="font-size: 12pt;">http://wiki.nginx.org/HttpRedis2Module</a>)</div><div>3   For communicating with Sphinx, I am trying to write a simple C++ client or adapt the Sphinx C++ client (<a href="http://sourceforge.net/projects/cppsphinxclient/" target="_blank" style="font-size: 12pt;">http://sourceforge.net/projects/cppsphinxclient/</a>) or its parts into an upstream module.</div><div><br></div><div>What I wanted to know is how to invoke the upstream modules within my main location module. Are there standard APIs provided by Nginx for the same and do they retain the async advantages? Or do I have to resort to make curl calls from my C++ client and use the response? I was hoping that the former (Nginx APIs to call upstream modules) exists in some form and serves as some "shortcut" or "faster" way/alternative to making some curl API calls.</div><div><br></div><div>Regards,</div><div>Reetesh</div>                                        </div></body>
</html>