Forum: NGINX My filter module is not called

2974d09ac2541e892966b762aad84943?d=identicon&s=25 ruslan_osmanov (Guest)
on 2013-08-11 15:15
(Received via mailing list)
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/
The module: http://bpaste.net/show/121900/

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

Regards.

--
Ruslan Osmanov

Posted at Nginx Forum:
http://forum.nginx.org/read.php?2,241761,241761#msg-241761
2974d09ac2541e892966b762aad84943?d=identicon&s=25 cubicdaiya (Guest)
on 2013-08-11 20:45
(Received via mailing list)
Hi.

2013/8/11 ruslan_osmanov <nginx-forum@nginx.us>
> 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/
> The module: 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
2974d09ac2541e892966b762aad84943?d=identicon&s=25 ruslan_osmanov (Guest)
on 2013-08-11 20:49
(Received via mailing list)
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:
http://forum.nginx.org/read.php?2,241761,241764#msg-241764
2974d09ac2541e892966b762aad84943?d=identicon&s=25 ruslan_osmanov (Guest)
on 2013-08-11 20:51
(Received via mailing list)
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:
http://forum.nginx.org/read.php?2,241761,241765#msg-241765
2974d09ac2541e892966b762aad84943?d=identicon&s=25 ruslan_osmanov (Guest)
on 2013-08-11 20:58
(Received via mailing list)
Yes, indeed, I had to put it into HTTP_FILTER_MODULES.

Thank you!

Posted at Nginx Forum:
http://forum.nginx.org/read.php?2,241761,241767#msg-241767
Please log in before posting. Registration is free and takes only a minute.
Existing account

NEW: Do you have a Google/GoogleMail, Yahoo or Facebook account? No registration required!
Log in with Google account | Log in with Yahoo account | Log in with Facebook account
No account? Register here.