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

Jim Popovitch jimpop at gmail.com
Tue Aug 18 16:59:05 UTC 2015


On Tue, Aug 18, 2015 at 12:56 PM, Dmitry <xeioex at nginx.com> wrote:
>
>
> On 18.08.2015 19:44, 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
>
> Only this option is applicable here.
>>
>>
>> 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?
>
>     sub_filter_once on;  is designed to support configurations like this
> one:
>
>     sub_filter '<head> '<head><link ...>';
>     sub_filter '<body> '<body><script ...>';
>
> Here, each replacement will be applied only once.
>

Thank you very much Dmitry

-Jim P.



More information about the nginx-devel mailing list