Proxy Retry Logic

Sirsiwal, Umesh usirsiwal at
Thu Dec 23 16:07:23 MSK 2010

Thanks Marcus,
In my application, I need to know once the subrequest has finally completed. I already have a module specific context attached with the subrequest. So I can easily use that to keep track of number of callbacks.

From: Eugaia [ngx.eugaia at]
Sent: Thursday, December 23, 2010 4:35 AM
To: nginx-devel at
Subject: Re: Proxy Retry Logic

On 23/12/2010 10:58, Eugaia wrote:
> Hi,
> On 23/12/2010 04:50, Sirsiwal, Umesh wrote:
>> I just tried using error_pages and have my post_subrequest return the
>> error code as Maxim had suggested.
>> That works very well. The only oddity is that I get two
>> post_subrequest callback for a single subrequest. That is something I
>> can handle my module.
> Good.  In your post_subrequest function, assuming you only want it
> called once, you should set sr->post_subrequest = NULL.
Or test to see if you've already run the post_subrequest by creating a
context struct and a flag to say whether you've called the function
before (but personally I prefer the former because then you don't end up
calling the same function loads of times unnecessarily).
> Marcus.

nginx-devel mailing list
nginx-devel at

More information about the nginx-devel mailing list