How to directly return in filter

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 www.aaa.com, but if request URL is www.bbb.com, I do not want
my handler do anything, and just let client access www.bbb.com page.

How can I achieve my aim. Thanks!

Jerry


Rejoice,I Desire!

Hello!

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

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 www.aaa.com, but if request URL is www.bbb.com, I do not want
my handler do anything, and just let client access www.bbb.com page.

How can I achieve my aim. Thanks!

Evan M.'s guide, as linked from
http://nginx.org/en/links.html, have a chapter about writing
filters:

And you may want to read other parts as well.


Maxim D.
http://nginx.org/