--add_module for filters?


#1

I’m trying to write a bare-bones body and header filter (just prints a
debugging message for headers and the body), and found that when I put
added it to the configuration with the --add-module configure directive,
it was placed BEFORE all of the filters in the load order (especially
the write filter). This meant that the http_write filter was called
before my filter, and my filter was never getting called (http_write
emits the output, assuming it’s at the ‘top’ of the chain).

Moving my module to the bottom of the list, after the
http_not_modified_filter_module in the objs/ngx_modules.c file, I was
able to get it to work as expected.

Besides editing objs/ngx_modules.c to manually place my module in the
correct order, is there any way to add in a non-standard filter into the
correct order in nginx’s configure command?

thanks,

-Brian M.


#2

Hello!

On Fri, Oct 03, 2008 at 10:18:44PM -0700, Brian M. wrote:

able to get it to work as expected.

Besides editing objs/ngx_modules.c to manually place my module in the
correct order, is there any way to add in a non-standard filter into the
correct order in nginx’s configure command?

In your module config file write something like this:

HTTP_AUX_FILTER_MODULES="$HTTP_AUX_FILTER_MODULES
ngx_http_my_filter_module"

You are probably adding it to $HTTP_MODULES instead, which is
wrong for filter modules.

Maxim D.


#3

Thanks, I’ll change my project to reflect that!