Welcome! Log In Create A New Profile

Advanced

Re: Help with chaining of sub-requests

Ashish S
April 17, 2012 03:48AM
Thank you for the pointers, agentzh!

--Ashish

On Tue, Apr 17, 2012 at 12:19 AM, agentzh <agentzh@gmail.com> wrote:
> On Tue, Apr 17, 2012 at 5:51 AM, Ashish S <ashishs.dev@gmail.com> wrote:
>>
>> I have 3 existing http backend web-services  S1, S2 and S3.  I am
>> trying to use nginx for a use-case where  i need to first get a "key"
>> from service S1, use this key along with some input data, to query S2,
>> and based on S2's response, query S3.    My question is, would
>> sub-request chaining be the best method to go about this?  I can use
>> the upstream method to connect to S1.   Am i doing something wrong, if
>> I then fire a sub-request (request to S2) from within the content
>> handler (process header) method registered for this upstream?.  How do
>> i then initiate the sub-request to S3 ?
>>
>> Any pointers or example that i might be able to follow, for something
>> like the above?
>>
>
> Regarding chained subrequest implementation, see ngx_echo module's
> echo_subrequest directive for an example:
>
>    http://wiki.nginx.org/HttpEchoModule#echo_subrequest
>
> Also ngx_lua's ngx.location.capture() and ngx.location.capture_multi()
> worth a look too:
>
>     http://wiki.nginx.org/HttpLuaModule#ngx.location.capture
>     http://wiki.nginx.org/HttpLuaModule#ngx.location.capture_multi
>
> Regarding non-subrequest upstream communication, ngx_lua supports the
> cosocket API which implements something similar to (but more general
> than) ngx_http_upstream:
>
>     http://wiki.nginx.org/HttpLuaModule#ngx.socket.tcp
>
> Hope these helps,
> -agentzh
>
> _______________________________________________
> nginx mailing list
> nginx@nginx.org
> http://mailman.nginx.org/mailman/listinfo/nginx

_______________________________________________
nginx mailing list
nginx@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx
Subject Author Posted

Help with chaining of sub-requests

Ashish S April 16, 2012 05:54PM

Re: Help with chaining of sub-requests

agentzh April 17, 2012 03:22AM

Re: Help with chaining of sub-requests

Ashish S April 17, 2012 03:48AM



Sorry, only registered users may post in this forum.

Click here to login

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