Welcome! Log In Create A New Profile

Advanced

Order of execution of nginx filters

Raghavan, Gopal
July 04, 2016 05:54PM
Hi

I have the following three directives:

location = /hello {
hello_world;
hola_mundo on;
bonjour_monde on;
}

hello_world is an nginx handler module that provides content “hello world”
hola_mundo and bonjour_monde are filters that add to the chain strings “hola mundo” and “bonjour monde” respectively.


Here is the output:
curl "http://localhost:8090/hello"
hello worldhola mundobonjour monde


Switching the filter directives in location block has no impact on output string.

For eg:

location = /hello {
hello_world;
bonjour_monde on;
hola_mundo on;
}

Here is the output:
curl "http://localhost:8090/hello"
hello worldhola mundobonjour monde


How do I control the order of execution of filters?
I already looked at objs/ngx_modules.c and auto/modules. My custom handlers and filters are not listed there.

One thing that I observed is that the order of listing the load_module modules/*.so in conf/nginx.conf does impact the order of execution of the filters.

Is there any other trick to adjust the execution order within the location block?

Thanks,
--
Gopal






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

Order of execution of nginx filters

Raghavan, Gopal 386 July 04, 2016 05:54PM

Re: Order of execution of nginx filters

Andrew Hutchings 162 July 05, 2016 05:42AM



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

Online Users

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