ngx_http_get_module_loc_conf() and r->internal weirdness

Maxim Dounin mdounin at mdounin.ru
Thu Jan 7 15:23:25 MSK 2010


Hello!

On Thu, Jan 07, 2010 at 07:19:55AM +0100, Srebrenko Šehić wrote:

> On Tue, Dec 29, 2009 at 11:03 PM, Srebrenko Šehić <ssehic at gmail.com> wrote:
> > Hi list,
> >
> > While working on extending nginx' Perl support, I stumbled upon the
> > following behavior.
> >
> > If an input handler issues a internal redirect via
> > ngx_http_internal_redirect(), a call to
> > ngx_http_get_module_loc_conf(r, ngx_http_X_module) inside an
> > NGX_HTTP_LOG_PHASE handler returns NULL. If the request is not an
> > internal redirect, the call returns the expected location config.
> >
> > Any idea why?
> 
> I've still found a solution for this. Anyone with a clue?

You are doing something wrong.  As you may see in log module - it 
uses ngx_http_get_module_loc_conf() happily and works ok with 
internal redirects.  Internal redirects clear module contexts, but 
not configs.

Maxim Dounin



More information about the nginx-devel mailing list