openresty / replace-filter-nginx-module

Streaming regular expression replacement in response bodies
260 stars 67 forks source link

Is it possible to add ON|OFF directive? #9

Closed makailol closed 10 years ago

makailol commented 10 years ago

Hello!

I have been using this module with my Nginx. I have added multiple replace_filter rules and all are working too. Now I would like to include it conditionally.

For example, if we set some nginx variable (with value on/off) based on that can we set this module (replace_filter) on/off ?

So is it possible to add some directives like replace_filter_enable On|Off ;

And if it is Off , replace_filter rules will not be executed.

Thanks,

agentzh commented 10 years ago

@makailol Yeah, we could have a replace_filter_skip directive, like below:

replace_filter_skip $skip;

Will you submit a patch for this? Thanks!

makailol commented 10 years ago

Sorry but I have no experience with module development. :( Otherwise I would definitely work for this.

Would you add it if you get bit time for this?

Thanks

agentzh commented 10 years ago

@makailol Yeah sure. I'll try to find some time :)

makailol commented 10 years ago

Thanks agentzh.

Just confirm about same in this ticket when you update this module.

agentzh commented 10 years ago

@makailol Yeah, sure.

makailol commented 10 years ago

@agentzh Would you get time to make this change this week?

Thanks,

agentzh commented 10 years ago

@makailol Sorry for the delay on my side! I'm already working on it :)

agentzh commented 10 years ago

@makailol Already implemented it in git master. Will you try it out on your side?

makailol commented 10 years ago

@agentzh , Thanks for implementing this directive. I have built nginx with latest changes and replace_filter_skip seems to be working.

agentzh commented 10 years ago

@makailol Cool! Thanks for the feedback!