subrequest concatenation

agentzh agentzh at
Mon May 10 07:39:00 MSD 2010

On Sat, May 8, 2010 at 1:37 AM, peterjanovsky <nginx-forum at> wrote:
> if someone would shed light on how subrequests are concatenated to the parent request and send to the client it'd be much appreciated.

The subrequest model is a bit complicated. Basically, there's a
r->postponed chain that glean responses from the subrequests as well
as the current (parent) request.

It's worth mentioning that there's also a r->posted_requests chain
that manage the "active request" relay sequence. Only the active
request can respond to the read/write event of the downstream
connection (i.e., r->connection).

> what happens now is that neither the parent request or concatenated subrequest are returned to my browser.  an empty request is returned to my browser after waiting for a response for up to 60 seconds.

It's not uncommon at all. I ran into similar issues last night (while
hacking on my ngx_srcache module) just because I didn't get every bit
right (see y explanation above). :)


More information about the nginx mailing list