Welcome! Log In Create A New Profile

Advanced

Re: Order of execution of nginx filters

B.R.
July 05, 2016 12:22PM
AFAIK you do not control the order of filters, and when you are building a
filter, you deal with data on-the-fly, which means your filter might be
invoked with a partial response coming from other filters.
Moreover, the module needs to 'win' its selection on a specific event.

I suggest you read some available literature (ex:
http://www.evanmiller.org/nginx-modules-guide.html, specifically
http://www.evanmiller.org/nginx-modules-guide.html#filters-body which seems
to implement something close to what you wish).

​There is most probably more competent people to that matter who would give
you better docs, but this is a head start I guess.​
---
*B. R.*

On Tue, Jul 5, 2016 at 6:06 AM, Raghavan, Gopal <gopal.raghavan@here.com>
wrote:

> 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 mailing list
> nginx@nginx.org
> http://mailman.nginx.org/mailman/listinfo/nginx
>
_______________________________________________
nginx mailing list
nginx@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx
Subject Author Posted

Order of execution of nginx filters

Raghavan, Gopal July 05, 2016 12:08AM

Re: Order of execution of nginx filters

B.R. July 05, 2016 12:22PM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

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