Buffers Chain

Maxim Dounin mdounin at mdounin.ru
Fri May 23 11:58:01 UTC 2014


Hello!

On Fri, May 23, 2014 at 11:57:20AM +0100, Paulo Silva wrote:

> there is other option than modify the auto/modules file?
> 
> According to my goal (capture the full request response body) I would
> say that my module must run right before the postpone.

Before the postpone filter you'll get subrequest bodies in your 
filter, which is probably not what you want (the postpone filter 
is to glue subrequest together, correctly ordered).

> Am I supposed to modify the auto/modules like follows?
> 
> if [ $HTTP_POSTPONE = YES ]; then
>     HTTP_FILTER_MODULES="$HTTP_FILTER_MODULES $HTTP_POSTPONE_FILTER_MODULE"
>     HTTP_SRCS="$HTTP_SRCS $HTTP_POSTPONE_FILTER_SRCS"
> fi
> 
> # insert my module here!
> 
> if [ $HTTP_SSI = YES ]; then
>     have=NGX_HTTP_SSI . auto/have
>     HTTP_FILTER_MODULES="$HTTP_FILTER_MODULES $HTTP_SSI_FILTER_MODULE"
>     HTTP_DEPS="$HTTP_DEPS $HTTP_SSI_DEPS"
>     HTTP_SRCS="$HTTP_SRCS $HTTP_SSI_SRCS"
> fi
> 
> 
> I did check my modules config file and I did realize that it is
> "queued" as HTTP_AUX_FILTER_MODULES. There are different queues for
> core modules and addons?

The HTTP_AUX_FILTER_MODULES is a generic queue, and it's the 
only one currently officially supported for 3rd party modules.

If you want your filter to be called right before/after postpone 
filter, it should be relatively safe to put it into the 
HTTP_POSTPONE_FILTER_MODULE variable though (and may be with some 
additional checks to make sure the postpone filter is enabled, or 
just a code to enable it unconditionally).

-- 
Maxim Dounin
http://nginx.org/



More information about the nginx-devel mailing list