Welcome! Log In Create A New Profile

Advanced

Re: Installing handlers in NGX_HTTP_LOG_PHASE

Maxim Dounin
December 23, 2009 08:46AM
Hello!

On Wed, Dec 23, 2009 at 01:52:19PM +0100, Srebrenko Šehić wrote:

> On Wed, Dec 23, 2009 at 11:07 AM, Maxim Dounin <mdounin@mdounin.ru> wrote:
>
> > This is somewhat expected as phases array are initialized after
> > reading configuration (see ngx_http.c for details).  The only
> > alternative is SIGBUS, not sure it's better.  :)
>
> That makes sense. Thanks.
>
> >> What is the correct approach to conditionally install a handler?
> >
> > In postconfiguration handler.  Nothing stops you from doing it
> > conditionally.
>
> What I wanted was not to install my handler at all. I guess if I do it
> like you suggest, the handler will have to return NGX_DECLINED if it's
> not supposed to run.

No, I mean you may install handler only if you've found during config
parsing that it's needed somewhere.

Of course returning NGX_DECLINED will work too. And actually it
must be implemented anyway, as phase handlers can't be different
for different servers/locations, while you probably want perl
handlers to be configured on per-server and per-location basis.

Maxim Dounin

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

Installing handlers in NGX_HTTP_LOG_PHASE

Srebrenko Šehić 4262 December 23, 2009 04:50AM

Re: Installing handlers in NGX_HTTP_LOG_PHASE

Maxim Dounin 1315 December 23, 2009 05:08AM

Re: Installing handlers in NGX_HTTP_LOG_PHASE

Srebrenko Šehić 1291 December 23, 2009 07:54AM

Re: Installing handlers in NGX_HTTP_LOG_PHASE

Maxim Dounin 1875 December 23, 2009 08:46AM

Re: Installing handlers in NGX_HTTP_LOG_PHASE

Piotr Sikora 1330 December 23, 2009 05:44AM

Re: Installing handlers in NGX_HTTP_LOG_PHASE

Srebrenko Šehić 1243 December 23, 2009 07:56AM



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

Online Users

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