[nginx] Sub filter: support of multiple strings to replace.

Valentin V. Bartenev vbart at nginx.com
Tue Aug 18 17:07:11 UTC 2015


On Tuesday 18 August 2015 12:44:06 Jim Popovitch wrote:
> On Tue, Aug 18, 2015 at 12:37 PM, Valentin V. Bartenev <vbart at nginx.com> wrote:
> > On Tuesday 18 August 2015 12:08:12 Jim Popovitch wrote:
> >> On Mon, Aug 17, 2015 at 10:44 AM, Dmitry Volyntsev <xeioex at nginx.com> wrote:
> >> > details:   http://hg.nginx.org/nginx/rev/b9447fc457b4
> >> > branches:
> >> > changeset: 6228:b9447fc457b4
> >> > user:      Dmitry Volyntsev <xeioex at nginx.com>
> >> > date:      Mon Aug 17 17:42:02 2015 +0300
> >> > description:
> >> > Sub filter: support of multiple strings to replace.
> >> >
> >>
> >> Hello,
> >>
> >> Can you please provide an example of use.
> >>
> >> Thank you!
> >>
> >
> > See an example in the module documentation:
> > http://nginx.org/en/docs/http/ngx_http_sub_module.html
> >
> 
> Thanks, I am aware of that.  What is missing from the docs is the
> format for multiple sub_filter entries.
> 
> Is it:
> 
> a) sub_filter "matchA" "replaceA" "matchB" "replaceB";
> 
> b) sub_filter "matchA" "replaceA"
>      sub_filter "matchB" "replaceB"
> 
> c) sub_fitler "match1" "match2" "match3" "replaceAll"
> 
> d) Only 1 sub_filter allowed per location or server
> 
> And then there's the issue of sub_filter_last_modified and
> sub_filter_once applying to all, or just the preceding or the
> following entry?
> 
> Multiple sub_filters is a great addition, docs are unclear on usage.  :-)
> 

Could you elaborate what exactly is unclear from the docs
with citations?  Then we will be able to improve it.

The "sub_filter" directive in the docs has specified syntax:

   	sub_filter string replacement;

and an explanation how it can be used several times:

 | Several sub_filter directives can be specified on one
 | configuration level"

The description of the "sub_filter_once" directive specifies
that "look for each string to replace".

And I don't really understand the confusion about the
"sub_filter_last_modified" directive, since it related to
the response header, not "sub_filter" directives.

  wbr, Valentin V. Bartenev



More information about the nginx-devel mailing list