How to directly return in filter

Maxim Dounin mdounin at
Fri Aug 1 14:35:03 UTC 2014


On Fri, Aug 01, 2014 at 05:56:48PM +0800, Jerry OELoo wrote:

> Hi All:
> I am developing a module in Nginx-1.6.0, Now My module work as a filter.
> static ngx_int_t ngx_http_my_handler(ngx_http_request_t *r)
> {
>      ...
>      return ngx_http_output_filter();
> }
> I use ngx_http_output_filter() to send the response to client.
> Now I want to do some extra thing in my handler, I can get the url
> from ngx_http_request_t, and I want just return some thing if request
> URL is, but if request URL is, I do not want
> my handler do anything, and just let client access page.
> How can I achieve my aim. Thanks!

Evan Miller's guide, as linked from, have a chapter about writing 

And you may want to read other parts as well.

Maxim Dounin

More information about the nginx mailing list