Welcome! Log In Create A New Profile

Advanced

Help on designing using multiple location/upstream modules

Reetesh Ranjan
November 26, 2013 11:39AM
Hi,
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.
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.
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 Sphinx2 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.
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.
Regards,Reetesh _______________________________________________
nginx-devel mailing list
nginx-devel@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx-devel
Subject Author Views Posted

Help on designing using multiple location/upstream modules

Reetesh Ranjan 714 November 26, 2013 11:39AM

RE: Help on designing using multiple location/upstream modules

Reetesh Ranjan 328 November 27, 2013 01:26AM

Re: Help on designing using multiple location/upstream modules

Yichun Zhang (agentzh) 312 November 27, 2013 03:40PM

RE: Help on designing using multiple location/upstream modules

Reetesh Ranjan 306 November 30, 2013 02:06PM

Re: Help on designing using multiple location/upstream modules

Yichun Zhang (agentzh) 338 November 30, 2013 05:38PM

RE: Help on designing using multiple location/upstream modules

Reetesh Ranjan 321 December 05, 2013 05:46AM



Sorry, you do not have permission to post/reply in this forum.

Online Users

Guests: 180
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready