# Wha difference between HTTP\_FILTER\_MODULES and HTTP\_AUX\_FILTER\_MODULES is it?

**URL:** <https://www.ruby-forum.com/t/wha-difference-between-http-filter-modules-and-http-aux-filter-modules-is-it/199539>\
**Category:** NGINX\
**Created:** [November 23, 2010, 5:01pm UTC](https://www.ruby-forum.com/t/wha-difference-between-http-filter-modules-and-http-aux-filter-modules-is-it/199539 "2010-11-23T17:01:59Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![okkezSS](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/o/85f322/32.png) [@okkezSS](https://www.ruby-forum.com/u/okkezSS)\
**Post date:** [November 23, 2010, 5:01pm UTC](https://www.ruby-forum.com/t/wha-difference-between-http-filter-modules-and-http-aux-filter-modules-is-it/199539/1 "2010-11-23T17:01:59Z")

</div>

If we want add a “string filter”, which chain should be registered?

thanks  
NextHop

---

<div class="post-metadata">

**Author:** ![quan\_nexthop](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/q/7feea3/32.png) [@quan\_nexthop](https://www.ruby-forum.com/u/quan_nexthop)\
**Post date:** [November 23, 2010, 5:56pm UTC](https://www.ruby-forum.com/t/wha-difference-between-http-filter-modules-and-http-aux-filter-modules-is-it/199539/2 "2010-11-23T17:56:37Z")

</div>

Hello!

On Tue, Nov 23, 2010 at 08:00:55AM -0800, quan nexthop wrote:

> If we want add a “string filter”, which chain should be registered?

Third party filters should use HTTP\_AUX\_FILTER\_MODULES (unless  
there is a really good reason to register elsewhere, e.g. you are  
developing something like bzip2 filter and need response with  
joined subrequests).

Maxim D.

---

<div class="post-metadata">

**Author:** ![quan\_nexthop](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/q/7feea3/32.png) [@quan\_nexthop](https://www.ruby-forum.com/u/quan_nexthop)\
**Post date:** [November 23, 2010, 6:24pm UTC](https://www.ruby-forum.com/t/wha-difference-between-http-filter-modules-and-http-aux-filter-modules-is-it/199539/3 "2010-11-23T18:24:16Z")

</div>

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.

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\_HEADERS\_FILTER\_MODULE   
$HTTP\_AUX\_FILTER\_MODULES   
$HTTP\_COPY\_FILTER\_MODULE   
$HTTP\_RANGE\_BODY\_FILTER\_MODULE   
$HTTP\_NOT\_MODIFIED\_FILTER\_MODULE   
$HTTP\_UPSTREAM\_CACHE\_MODELE"

What does it mean and when should it be used ?

thanks  
NextHop

---

<div class="post-metadata">

**Author:** ![quan\_nexthop](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/q/7feea3/32.png) [@quan\_nexthop](https://www.ruby-forum.com/u/quan_nexthop)\
**Post date:** [November 23, 2010, 7:13pm UTC](https://www.ruby-forum.com/t/wha-difference-between-http-filter-modules-and-http-aux-filter-modules-is-it/199539/4 "2010-11-23T19:13:14Z")

</div>

Hello!

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.

> ```
> $HTTP_UPSTREAM_CACHE_MODELE"
> 
> ```

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 D.
