# My filter module is not called

**URL:** <https://www.ruby-forum.com/t/my-filter-module-is-not-called/236161>\
**Category:** NGINX\
**Created:** [August 11, 2013, 3:15pm UTC](https://www.ruby-forum.com/t/my-filter-module-is-not-called/236161 "2013-08-11T15:15:53Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![alcina](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/a587f6/32.png) [@alcina](https://www.ruby-forum.com/u/alcina)\
**Post date:** [August 11, 2013, 3:15pm UTC](https://www.ruby-forum.com/t/my-filter-module-is-not-called/236161/1 "2013-08-11T15:15:53Z")

</div>

Hi,

I’m writing a filter module which will output static files according to  
information returned by an upstream handler like FastCGI, or Apache.

There is some testing code in header/body filters. I’m launching the  
server  
merely to see whether my code is invoked. All configuration and cleanup  
stuff  
seems to be working. But the header/body filters are not called at  
all(both  
call  
ngx\_log\_error).

Vhost configuration: [http://bpaste.net/show/121898/](http://bpaste.net/show/121898/)  
The module: [http://bpaste.net/show/121900/](http://bpaste.net/show/121900/)

Please help to figure out what’s wrong with it.

Regards.

–  
Ruslan Osmanov

Posted at Nginx Forum:

> **[My filter module is not called](https://forum.nginx.org/read.php?2,241761,241761#msg-241761)**
>
> Hi, I'm writing a filter module which will output static files according to information returned by an upstream handler like FastCGI, or Apache. There is some testing code in header/body filters. I'm launching the server merely to see whether my code...

---

<div class="post-metadata">

**Author:** ![ruslan\_osmanov](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/3e96dc/32.png) [@ruslan\_osmanov](https://www.ruby-forum.com/u/ruslan_osmanov)\
**Post date:** [August 11, 2013, 8:45pm UTC](https://www.ruby-forum.com/t/my-filter-module-is-not-called/236161/2 "2013-08-11T20:45:19Z")

</div>

Hi.

2013/8/11 ruslan\_osmanov [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)

> There is some testing code in header/body filters. I’m launching the  
> server  
> merely to see whether my code is invoked. All configuration and cleanup  
> stuff  
> seems to be working. But the header/body filters are not called at  
> all(both  
> call  
> ngx\_log\_error).
> 
> Vhost configuration: [http://bpaste.net/show/121898/](http://bpaste.net/show/121898/)  
> The module: [http://bpaste.net/show/121900/](http://bpaste.net/show/121900/)
> 
> Please help to figure out what’s wrong with it.

> <https://gist.github.com/cubicdaiya/6206206>

After I built your module with the above config  
the header/body filter functions are called in my environment.  
Maybe the cause is in config. For example, using HTTP\_MODULES instead of  
HTTP\_FILTER\_MODULES.

Posted at Nginx Forum:  
[http://forum.nginx.org/read.php?2,241761,241763#msg-241763](http://forum.nginx.org/read.php?2,241761,241763#msg-241763)

---

<div class="post-metadata">

**Author:** ![ruslan\_osmanov](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/3e96dc/32.png) [@ruslan\_osmanov](https://www.ruby-forum.com/u/ruslan_osmanov)\
**Post date:** [August 11, 2013, 8:49pm UTC](https://www.ruby-forum.com/t/my-filter-module-is-not-called/236161/3 "2013-08-11T20:49:25Z")

</div>

Thank you for the reply.

Hmm, maybe I build it different way. I have the following files to  
configure, make and install it:

conf.sh:

cd ~/src/nginx  
./auto/configure --prefix=/home/ruslan   
–with-debug   
–conf-path=/home/ruslan/etc/nginx/nginx.conf   
–user=ruslan   
–group=www   
–pid-path=/home/ruslan/var/run/nginx.pid   
–lock-path=/home/ruslan/var/run/nginx.lock   
–error-log-path=/home/ruslan/var/log/nginx/error.log   
–add-module=/home/ruslan/projects/nginx/modules/file\_chunks\_filter

make.sh

cd ~/src/nginx  
make -j7

install.sh

cd ~/src/nginx  
make install

So I simply run ./conf.sh ; ./make.sh ; install.sh. Isn’t it right? Or,  
should I modify the nginx configuration?

Thanks.

Posted at Nginx Forum:

> **[Re: My filter module is not called](https://forum.nginx.org/read.php?2,241761,241764#msg-241764)**
>
> Hi, I'm writing a filter module which will output static files according to information returned by an upstream handler like FastCGI, or Apache. There is some testing code in header/body filters. I'm launching the server merely to see whether my code...

---

<div class="post-metadata">

**Author:** ![ruslan\_osmanov](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/3e96dc/32.png) [@ruslan\_osmanov](https://www.ruby-forum.com/u/ruslan_osmanov)\
**Post date:** [August 11, 2013, 8:51pm UTC](https://www.ruby-forum.com/t/my-filter-module-is-not-called/236161/4 "2013-08-11T20:51:45Z")

</div>

Oh, sorry, the `config` file contains:

ngx\_addon\_name=ngx\_http\_file\_chunks\_filter\_module

HTTP\_MODULES=“$HTTP\_MODULES ngx\_http\_file\_chunks\_filter\_module”

HTTP\_INCS=“$HTTP\_INCS /usr/include/libxml2 "  
CORE\_LIBS=”$CORE\_LIBS -lxml2"

NGX\_ADDON\_SRCS=“$NGX\_ADDON\_SRCS  
$ngx\_addon\_dir/ngx\_http\_file\_chunks\_filter\_module.c”

Posted at Nginx Forum:

> **[Re: My filter module is not called](https://forum.nginx.org/read.php?2,241761,241765#msg-241765)**
>
> Hi, I'm writing a filter module which will output static files according to information returned by an upstream handler like FastCGI, or Apache. There is some testing code in header/body filters. I'm launching the server merely to see whether my code...

---

<div class="post-metadata">

**Author:** ![ruslan\_osmanov](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/3e96dc/32.png) [@ruslan\_osmanov](https://www.ruby-forum.com/u/ruslan_osmanov)\
**Post date:** [August 11, 2013, 8:58pm UTC](https://www.ruby-forum.com/t/my-filter-module-is-not-called/236161/5 "2013-08-11T20:58:11Z")

</div>

Yes, indeed, I had to put it into HTTP\_FILTER\_MODULES.

Thank you!

Posted at Nginx Forum:

> **[Re: My filter module is not called](https://forum.nginx.org/read.php?2,241761,241767#msg-241767)**
>
> Hi, I'm writing a filter module which will output static files according to information returned by an upstream handler like FastCGI, or Apache. There is some testing code in header/body filters. I'm launching the server merely to see whether my code...
