Installing handlers in NGX_HTTP_LOG_PHASE

Srebrenko Šehić ssehic at gmail.com
Wed Dec 23 15:52:19 MSK 2009


On Wed, Dec 23, 2009 at 11:07 AM, Maxim Dounin <mdounin at 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.



More information about the nginx-devel mailing list