Welcome! Log In Create A New Profile

Advanced

Rewrite handling order

January 14, 2014 05:46AM
Hi

I have a custom plugin that handles rewrite (NGX_HTTP_REWRITE_PHASE). There
is another plugin compiled before my plugin that also handles rewrite
(HttpLuaModule). I was expecting to see that my module would rewrite after
lua is done, however that is not the case. Some debugging showed that
whereas my module pushed into the
cmcf->phases[NGX_HTTP_REWRITE_PHASE].handlers after lua, the
cmcf.phase_engine.handlers had lua *after* my module. The culprit seems to
be the following:

static ngx_int_t
ngx_http_init_phase_handlers(ngx_conf_t *cf, ngx_http_core_main_conf_t
*cmcf)
{
...
ph = cmcf->phase_engine.handlers;
...
n += cmcf->phases[i].handlers.nelts;

for (j = cmcf->phases[i].handlers.nelts - 1; j >=0; j--) {
ph->checker = checker;
ph->handler = h[j];
ph->next = n;
ph++;
}
}

The order is inverted here (h[j] before h[j-1]). Is this intentional or a
bug?

Thanks!
_______________________________________________
nginx-devel mailing list
nginx-devel@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx-devel
Subject Author Views Posted

Rewrite handling order

faskiri.devel 793 January 14, 2014 05:46AM

Re: Rewrite handling order

Maxim Dounin 317 January 14, 2014 06:12AM

Re: Rewrite handling order

faskiri.devel 361 January 14, 2014 08:26AM

Re: Rewrite handling order

Ruslan Ermilov 308 January 14, 2014 09:58AM

Re: Rewrite handling order

faskiri.devel 415 January 15, 2014 07:02AM



Sorry, you do not have permission to post/reply in this forum.

Online Users

Guests: 124
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