ngx_module_order directive

Maxim Dounin mdounin at
Mon Jun 10 12:55:23 UTC 2019


On Sat, Jun 08, 2019 at 12:44:29AM +0000, Carey Gister wrote:

> I'm writing a new module and I want to place in a specific order in the module list as defined in ngx_modules.c.
> If my module name is x_module and I want it to run after ngx_http_slice_filter_module I tried:
> ngx_module_order=x_module ngx_http_slice_filter_module
> and I am informed during configuration that 'ngx_http_slice_filter_module does not exist.
> What is the correct syntax for this directive?

The config file is a shell script, and expected to follow POSIX 
shell syntax.  That is, to define a variable with a space in it 
you have to use double quotes:

ngx_module_order="x_module ngx_http_slice_filter_module"

Note well that it is generally a bad idea to explicitly define 
module order unless you know what are you doing and why.

Maxim Dounin

More information about the nginx-devel mailing list