Forum: NGINX --add_module for filters?

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
Brian M. (Guest)
on 2008-10-04 09:26
(Received via mailing list)
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.
Maxim D. (Guest)
on 2008-10-04 14:08
(Received via mailing list)
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.
Brian M. (Guest)
on 2008-10-06 20:38
(Received via mailing list)
Thanks, I'll change my project to reflect that!
This topic is locked and can not be replied to.