Hello!
On Fri, Nov 14, 2014 at 10:40 PM, Gaurav Kumar wrote:
> Thanks Agentzh!
Please do not capitalize my nick. Thank you.
> Actually http method was just an example, I would need to
> conditionally process response based on post request parameters or even get
> request paramters. I don't think header filter will help.
It can surely help here.
> Anyways the bigger
> question is even if I can use access request filter or something similar
> directive, how do I combine the two directives? In other words how do I make
> sure body_filter_by_lua is being invoked in response to a specific request
> only.
You can set flags in ngx.ctx in access_by_lua, for example, and make
decisions in header/body_filter_by_lua. The header/body_filter_by_lua
directives themselves are very cheap so it's totally fine that you
just check the flags in ngx.ctx and do nothing there.
Regards,
-agentzh