Wha difference between HTTP_FILTER_MODULES and HTTP_AUX_FILTER_MODULES is it?

Maxim Dounin mdounin at mdounin.ru
Tue Nov 23 21:11:35 MSK 2010


On Tue, Nov 23, 2010 at 09:22:58AM -0800, quan nexthop wrote:

> Hi Maxim:
> Thanks your response quickly.
> I try to development a filter module(string filter for request body),
> however, I found that
>   1) use HTTP_FILTER_MODULES to register, the module works well
>   2) use HTTP_AUX_FILTER_MODULES, it does not work.

So the question are: what your module does exactly (i.e. sources), 
how do you add it (i.e. module ./config source) and how do you 
test it (i.e. test case with expected output and output you got).  
"Does not work" means basically nothing.

Assuming correct module code and ./config script the only 
difference between adding filter to HTTP_AUX_FILTER_MODULES and 
HTTP_FILTER_MODULES is that in later case your module will be able 
to see output headers added by headers filter (i.e. add_header 
directive).  With something being incorrect things may vary widely.

> I wonder why there is two different behavior for the MODULE_NAME;
> I also check the config file of NGINX, there are several MODULE :
> if [ $HTTP = YES ]; then
>     modules="$modules $HTTP_MODULES $HTTP_FILTER_MODULES \
>              $HTTP_AUX_FILTER_MODULES \
>              $HTTP_COPY_FILTER_MODULE \

It looks like you've already screwed up your nginx sources. There 
shouldn't be anything like "HTTP_UPSTREAM_CACHE_MODELE" here.  
Re-downloading/extracting nginx sources may be a good idea.

> What does it mean and when should it be used ?

There are lots of modules in nginx, and each of them needed for 
something.  Feel free to read docs and sources to find out what 
exactly each module is needed for.  These part of configure script 
basically lines up various http modules and http filter modules.

And again: the only place in the filter chain where third party 
modules is expected be installed is HTTP_AUX_FILTER_MODULES.   You 
should have really good reason to install your module anywhere 
else, and if you do it - you do it at your own risk.

Maxim Dounin

More information about the nginx mailing list