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 Moran
on 2008-10-04 07:26
on 2008-10-04 12:08
Hello! On Fri, Oct 03, 2008 at 10:18:44PM -0700, Brian Moran 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 Dounin
on 2008-10-06 18:38
Thanks, I'll change my project to reflect that!