Welcome! Log In Create A New Profile

Advanced

NGINX request phase handlers

Posted by lakshay.gaba 
NGINX request phase handlers
February 17, 2021 03:22AM
Hi, as we know NGINX HTTP request passes through a sequence of phases like NGX_HTTP_POST_READ_PHASE so on and many standard nginx modules register their phase handlers as a way to get called at a specific stage of request processing.

Now, we can build our own module and hook at any phase by doing something like:
h = ngx_array_push (& cmcf-> phases [NGX_HTTP_CONTENT_PHASE] .handlers);
* h = ngx_http_hello_handler;

As multiple modules can register at a single phase, I am developing a module which needs to register its handler in a specific phase and also after a specific standard nginx module handler i.e. if ngx_http_realip_module registers its handler at NGX_HTTP_POST_READ_PHASE, i want my handler to hook after this particular module in the sequence.

What would be the best approach to proceed with the same?
Re: NGINX request phase handlers
March 17, 2021 09:52AM
I m in the learning stage I think Nginx is good platform
Sorry, only registered users may post in this forum.

Click here to login

Online Users

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