error_page and module contexts

Maxim Dounin mdounin at
Fri Feb 3 17:52:54 UTC 2012


On Fri, Feb 03, 2012 at 08:53:26AM -0800, Dave Bailey wrote:

> Hi,
> As of nginx 1.1.6, it seems that the error_page directive can no longer be
> used in a way that preserves module contexts to the log phase of the
> request cycle.  This means that if I have a log handler which expects some
> information that had been saved in a module context before the error_page
> logic is invoked, that information is no longer accessible when the log
> handler is actually called.  Is there a way to work around this?

Currently the only thing which survives internal redirects (and 
redirection to a named location as of 1.1.6+) is variables.  If 
you need something persistant, you may register one and store 
needed information there (up to a pointer to your module context, 

Maxim Dounin

More information about the nginx-devel mailing list