Usage of the shadow field in ngx_buf_t?

Peter Leonov gojpeg at
Fri Dec 4 05:25:09 MSK 2009

Hi, Brian!

On 04.12.2009, at 4:35, agentzh wrote:

> On Fri, Dec 4, 2009 at 7:13 AM, Brian Pane <brianp at> wrote:
>> A follow-up question: When a body filter is processing buffers that
>> were produced by the proxy module (i.e., buffers containing an HTTP response
>> from a back-end server), is it safe to discard those buffers?
> I think so :)

So do I :)

> My ngx_chunkin module's output body filter does
> something like that to simply disgard the contents of the 411 error
> page and I don't think an upstream module like ngx_proxy will have any
> difference here :)

I'v played with totally discarding the whole body, and that was OK.
More to say, you may create a shiny new chain and send it instead of that passed to your filter.
Please be careful, do not forget to allocate chain links and buffers from the pool of the current request while there is no extreme need to store data elsewhere.


More information about the nginx-devel mailing list