Welcome! Log In Create A New Profile

Advanced

Re: How to control the order of execution modules in nginx

Maxim Dounin
January 30, 2014 07:10AM
Hello!

On Thu, Jan 30, 2014 at 01:05:34PM +0800, Rv Rv wrote:

> From http://www.evanmiller.org/nginx-modules-guide.html, "The
> order of their execution is determined at compile-time". Is
> there a way to control this. ngx_modules.c has the list and
> order of execution. How do I change the order of execution of
> modules within a particular phase e.g. if I have three modules
> within the access phase, is there a way to control the order of
> execution with the access phase. 

Order of execution of modules in a particular phase is set during
a configure, modules which are last in HTTP_MODULES are executed
first.

That is, if you want to add "module1", "module2", and "module3",
all of them use the access phase, and each of them does something
like

HTTP_MODULES="$HTTP_MODULES moduleN"

in it's "config" file, you should do something like

./configure --add-module=module3 \
--add-module=module2 \
--add-module=module1

to get the "module1 -> module2 -> module3" order.

Note that it may non-trivial to, e.g., make sure your module is
called after standard modules in the access phase.

--
Maxim Dounin
http://nginx.org/

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

How to control the order of execution modules in nginx

Rv Rv January 30, 2014 12:06AM

Re: How to control the order of execution modules in nginx

Maxim Dounin January 30, 2014 07:10AM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 167
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 500 on July 15, 2024
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready