Mercurial > hg > nginx-site
changeset 1555:2a79b38f640b
Sub filter: documented support of multiple strings to replace.
author | Yaroslav Zhuravlev <yar@nginx.com> |
---|---|
date | Tue, 18 Aug 2015 19:14:27 +0300 |
parents | 80aba0439f7d |
children | 959e19af8b36 |
files | xml/en/docs/http/ngx_http_sub_module.xml xml/ru/docs/http/ngx_http_sub_module.xml |
diffstat | 2 files changed, 14 insertions(+), 10 deletions(-) [+] |
line wrap: on
line diff
--- a/xml/en/docs/http/ngx_http_sub_module.xml Tue Aug 18 17:00:38 2015 +0300 +++ b/xml/en/docs/http/ngx_http_sub_module.xml Tue Aug 18 19:14:27 2015 +0300 @@ -10,7 +10,7 @@ <module name="Module ngx_http_sub_module" link="/en/docs/http/ngx_http_sub_module.html" lang="en" - rev="3"> + rev="4"> <section id="summary"> @@ -33,8 +33,8 @@ <para> <example> location / { - sub_filter </head> - '</head><script language="javascript" src="$script"></script>'; + sub_filter '<a href="http://127.0.0.1:8080/' '<a href="https://$host/'; + sub_filter '<img src="http://127.0.0.1:8080/' '<img src="https://$host/'; sub_filter_once on; } </example> @@ -56,6 +56,8 @@ Sets a string to replace and a replacement string. The string to replace is matched ignoring the case. The string to replace (1.9.4) and replacement string can contain variables. +Several <literal>sub_filter</literal> directives +can be specified on one configuration level (1.9.4). </para> </directive> @@ -91,8 +93,8 @@ <context>location</context> <para> -Indicates whether to look for a string to replace once or -several times. +Indicates whether to look for each string to replace +once or repeatedly. </para> </directive>
--- a/xml/ru/docs/http/ngx_http_sub_module.xml Tue Aug 18 17:00:38 2015 +0300 +++ b/xml/ru/docs/http/ngx_http_sub_module.xml Tue Aug 18 19:14:27 2015 +0300 @@ -10,7 +10,7 @@ <module name="Модуль ngx_http_sub_module" link="/ru/docs/http/ngx_http_sub_module.html" lang="ru" - rev="3"> + rev="4"> <section id="summary"> @@ -33,8 +33,8 @@ <para> <example> location / { - sub_filter </head> - '</head><script language="javascript" src="$script"></script>'; + sub_filter '<a href="http://127.0.0.1:8080/' '<a href="https://$host/'; + sub_filter '<img src="http://127.0.0.1:8080/' '<img src="https://$host/'; sub_filter_once on; } </example> @@ -56,6 +56,8 @@ Задаёт строку, которую нужно заменить, и строку замены. Заменяемая строка проверяется без учёта регистра. В заменяемой строке (1.9.4) и в строке замены можно использовать переменные. +На одном уровне может +быть указано несколько директив <literal>sub_filter</literal> (1.9.4). </para> </directive> @@ -91,8 +93,8 @@ <context>location</context> <para> -Определяет, сколько раз нужно искать заменяемую строку: один -раз или несколько раз. +Определяет, сколько раз нужно искать каждую из заменяемых строк: +один раз или многократно. </para> </directive>