Mercurial > hg > nginx-site
annotate xml/en/docs/http/ngx_http_sub_module.xml @ 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 | dc1e51247404 |
rev | line source |
---|---|
348
5a848934a12d
English translation of ngx_http_geoip_module, ngx_http_map_module,
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
1 <?xml version="1.0"?> |
5a848934a12d
English translation of ngx_http_geoip_module, ngx_http_map_module,
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
2 |
580
be54c443235a
Added copyright markers to documentation sources.
Ruslan Ermilov <ru@nginx.com>
parents:
546
diff
changeset
|
3 <!-- |
be54c443235a
Added copyright markers to documentation sources.
Ruslan Ermilov <ru@nginx.com>
parents:
546
diff
changeset
|
4 Copyright (C) Igor Sysoev |
be54c443235a
Added copyright markers to documentation sources.
Ruslan Ermilov <ru@nginx.com>
parents:
546
diff
changeset
|
5 Copyright (C) Nginx, Inc. |
be54c443235a
Added copyright markers to documentation sources.
Ruslan Ermilov <ru@nginx.com>
parents:
546
diff
changeset
|
6 --> |
be54c443235a
Added copyright markers to documentation sources.
Ruslan Ermilov <ru@nginx.com>
parents:
546
diff
changeset
|
7 |
348
5a848934a12d
English translation of ngx_http_geoip_module, ngx_http_map_module,
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
8 <!DOCTYPE module SYSTEM "../../../../dtd/module.dtd"> |
5a848934a12d
English translation of ngx_http_geoip_module, ngx_http_map_module,
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
9 |
5a848934a12d
English translation of ngx_http_geoip_module, ngx_http_map_module,
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
10 <module name="Module ngx_http_sub_module" |
5a848934a12d
English translation of ngx_http_geoip_module, ngx_http_map_module,
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
11 link="/en/docs/http/ngx_http_sub_module.html" |
589 | 12 lang="en" |
1555
2a79b38f640b
Sub filter: documented support of multiple strings to replace.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1554
diff
changeset
|
13 rev="4"> |
348
5a848934a12d
English translation of ngx_http_geoip_module, ngx_http_map_module,
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
14 |
5a848934a12d
English translation of ngx_http_geoip_module, ngx_http_map_module,
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
15 <section id="summary"> |
5a848934a12d
English translation of ngx_http_geoip_module, ngx_http_map_module,
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
16 |
5a848934a12d
English translation of ngx_http_geoip_module, ngx_http_map_module,
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
17 <para> |
5a848934a12d
English translation of ngx_http_geoip_module, ngx_http_map_module,
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
18 The <literal>ngx_http_sub_module</literal> module is a filter |
5a848934a12d
English translation of ngx_http_geoip_module, ngx_http_map_module,
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
19 that modifies a response by replacing one specified string by another. |
5a848934a12d
English translation of ngx_http_geoip_module, ngx_http_map_module,
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
20 </para> |
5a848934a12d
English translation of ngx_http_geoip_module, ngx_http_map_module,
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
21 |
5a848934a12d
English translation of ngx_http_geoip_module, ngx_http_map_module,
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
22 <para> |
5a848934a12d
English translation of ngx_http_geoip_module, ngx_http_map_module,
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
23 This module is not built by default, it should be enabled with the |
5a848934a12d
English translation of ngx_http_geoip_module, ngx_http_map_module,
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
24 <literal>--with-http_sub_module</literal> |
5a848934a12d
English translation of ngx_http_geoip_module, ngx_http_map_module,
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
25 configuration parameter. |
5a848934a12d
English translation of ngx_http_geoip_module, ngx_http_map_module,
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
26 </para> |
5a848934a12d
English translation of ngx_http_geoip_module, ngx_http_map_module,
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
27 |
5a848934a12d
English translation of ngx_http_geoip_module, ngx_http_map_module,
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
28 </section> |
5a848934a12d
English translation of ngx_http_geoip_module, ngx_http_map_module,
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
29 |
5a848934a12d
English translation of ngx_http_geoip_module, ngx_http_map_module,
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
30 |
5a848934a12d
English translation of ngx_http_geoip_module, ngx_http_map_module,
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
31 <section id="example" name="Example Configuration"> |
5a848934a12d
English translation of ngx_http_geoip_module, ngx_http_map_module,
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
32 |
5a848934a12d
English translation of ngx_http_geoip_module, ngx_http_map_module,
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
33 <para> |
5a848934a12d
English translation of ngx_http_geoip_module, ngx_http_map_module,
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
34 <example> |
5a848934a12d
English translation of ngx_http_geoip_module, ngx_http_map_module,
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
35 location / { |
1555
2a79b38f640b
Sub filter: documented support of multiple strings to replace.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1554
diff
changeset
|
36 sub_filter '<a href="http://127.0.0.1:8080/' '<a href="https://$host/'; |
2a79b38f640b
Sub filter: documented support of multiple strings to replace.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1554
diff
changeset
|
37 sub_filter '<img src="http://127.0.0.1:8080/' '<img src="https://$host/'; |
348
5a848934a12d
English translation of ngx_http_geoip_module, ngx_http_map_module,
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
38 sub_filter_once on; |
5a848934a12d
English translation of ngx_http_geoip_module, ngx_http_map_module,
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
39 } |
5a848934a12d
English translation of ngx_http_geoip_module, ngx_http_map_module,
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
40 </example> |
5a848934a12d
English translation of ngx_http_geoip_module, ngx_http_map_module,
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
41 </para> |
5a848934a12d
English translation of ngx_http_geoip_module, ngx_http_map_module,
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
42 |
5a848934a12d
English translation of ngx_http_geoip_module, ngx_http_map_module,
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
43 </section> |
5a848934a12d
English translation of ngx_http_geoip_module, ngx_http_map_module,
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
44 |
5a848934a12d
English translation of ngx_http_geoip_module, ngx_http_map_module,
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
45 |
5a848934a12d
English translation of ngx_http_geoip_module, ngx_http_map_module,
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
46 <section id="directives" name="Directives"> |
5a848934a12d
English translation of ngx_http_geoip_module, ngx_http_map_module,
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
47 |
5a848934a12d
English translation of ngx_http_geoip_module, ngx_http_map_module,
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
48 <directive name="sub_filter"> |
5a848934a12d
English translation of ngx_http_geoip_module, ngx_http_map_module,
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
49 <syntax><value>string</value> <value>replacement</value></syntax> |
5a848934a12d
English translation of ngx_http_geoip_module, ngx_http_map_module,
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
50 <default/> |
5a848934a12d
English translation of ngx_http_geoip_module, ngx_http_map_module,
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
51 <context>http</context> |
5a848934a12d
English translation of ngx_http_geoip_module, ngx_http_map_module,
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
52 <context>server</context> |
5a848934a12d
English translation of ngx_http_geoip_module, ngx_http_map_module,
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
53 <context>location</context> |
5a848934a12d
English translation of ngx_http_geoip_module, ngx_http_map_module,
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
54 |
5a848934a12d
English translation of ngx_http_geoip_module, ngx_http_map_module,
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
55 <para> |
966 | 56 Sets a string to replace and a replacement string. |
57 The string to replace is matched ignoring the case. | |
1554
80aba0439f7d
Sub filter: documented variables support in strings to replace.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
966
diff
changeset
|
58 The string to replace (1.9.4) and replacement string can contain variables. |
1555
2a79b38f640b
Sub filter: documented support of multiple strings to replace.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1554
diff
changeset
|
59 Several <literal>sub_filter</literal> directives |
2a79b38f640b
Sub filter: documented support of multiple strings to replace.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1554
diff
changeset
|
60 can be specified on one configuration level (1.9.4). |
348
5a848934a12d
English translation of ngx_http_geoip_module, ngx_http_map_module,
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
61 </para> |
5a848934a12d
English translation of ngx_http_geoip_module, ngx_http_map_module,
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
62 |
5a848934a12d
English translation of ngx_http_geoip_module, ngx_http_map_module,
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
63 </directive> |
5a848934a12d
English translation of ngx_http_geoip_module, ngx_http_map_module,
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
64 |
5a848934a12d
English translation of ngx_http_geoip_module, ngx_http_map_module,
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
65 |
918
ae785c6aaa91
Documented ssi/sub_filter/xslt_last_modified.
Maxim Dounin <mdounin@mdounin.ru>
parents:
589
diff
changeset
|
66 <directive name="sub_filter_last_modified"> |
ae785c6aaa91
Documented ssi/sub_filter/xslt_last_modified.
Maxim Dounin <mdounin@mdounin.ru>
parents:
589
diff
changeset
|
67 <syntax><literal>on</literal> | <literal>off</literal></syntax> |
ae785c6aaa91
Documented ssi/sub_filter/xslt_last_modified.
Maxim Dounin <mdounin@mdounin.ru>
parents:
589
diff
changeset
|
68 <default>off</default> |
ae785c6aaa91
Documented ssi/sub_filter/xslt_last_modified.
Maxim Dounin <mdounin@mdounin.ru>
parents:
589
diff
changeset
|
69 <context>http</context> |
ae785c6aaa91
Documented ssi/sub_filter/xslt_last_modified.
Maxim Dounin <mdounin@mdounin.ru>
parents:
589
diff
changeset
|
70 <context>server</context> |
ae785c6aaa91
Documented ssi/sub_filter/xslt_last_modified.
Maxim Dounin <mdounin@mdounin.ru>
parents:
589
diff
changeset
|
71 <context>location</context> |
ae785c6aaa91
Documented ssi/sub_filter/xslt_last_modified.
Maxim Dounin <mdounin@mdounin.ru>
parents:
589
diff
changeset
|
72 <appeared-in>1.5.1</appeared-in> |
ae785c6aaa91
Documented ssi/sub_filter/xslt_last_modified.
Maxim Dounin <mdounin@mdounin.ru>
parents:
589
diff
changeset
|
73 |
ae785c6aaa91
Documented ssi/sub_filter/xslt_last_modified.
Maxim Dounin <mdounin@mdounin.ru>
parents:
589
diff
changeset
|
74 <para> |
966 | 75 Allows preserving the <header>Last-Modified</header> header field |
918
ae785c6aaa91
Documented ssi/sub_filter/xslt_last_modified.
Maxim Dounin <mdounin@mdounin.ru>
parents:
589
diff
changeset
|
76 from the original response during replacement |
ae785c6aaa91
Documented ssi/sub_filter/xslt_last_modified.
Maxim Dounin <mdounin@mdounin.ru>
parents:
589
diff
changeset
|
77 to facilitate response caching. |
ae785c6aaa91
Documented ssi/sub_filter/xslt_last_modified.
Maxim Dounin <mdounin@mdounin.ru>
parents:
589
diff
changeset
|
78 </para> |
ae785c6aaa91
Documented ssi/sub_filter/xslt_last_modified.
Maxim Dounin <mdounin@mdounin.ru>
parents:
589
diff
changeset
|
79 |
ae785c6aaa91
Documented ssi/sub_filter/xslt_last_modified.
Maxim Dounin <mdounin@mdounin.ru>
parents:
589
diff
changeset
|
80 <para> |
ae785c6aaa91
Documented ssi/sub_filter/xslt_last_modified.
Maxim Dounin <mdounin@mdounin.ru>
parents:
589
diff
changeset
|
81 By default, the header field is removed as contents of the response |
ae785c6aaa91
Documented ssi/sub_filter/xslt_last_modified.
Maxim Dounin <mdounin@mdounin.ru>
parents:
589
diff
changeset
|
82 are modified during processing. |
ae785c6aaa91
Documented ssi/sub_filter/xslt_last_modified.
Maxim Dounin <mdounin@mdounin.ru>
parents:
589
diff
changeset
|
83 </para> |
ae785c6aaa91
Documented ssi/sub_filter/xslt_last_modified.
Maxim Dounin <mdounin@mdounin.ru>
parents:
589
diff
changeset
|
84 |
ae785c6aaa91
Documented ssi/sub_filter/xslt_last_modified.
Maxim Dounin <mdounin@mdounin.ru>
parents:
589
diff
changeset
|
85 </directive> |
ae785c6aaa91
Documented ssi/sub_filter/xslt_last_modified.
Maxim Dounin <mdounin@mdounin.ru>
parents:
589
diff
changeset
|
86 |
ae785c6aaa91
Documented ssi/sub_filter/xslt_last_modified.
Maxim Dounin <mdounin@mdounin.ru>
parents:
589
diff
changeset
|
87 |
348
5a848934a12d
English translation of ngx_http_geoip_module, ngx_http_map_module,
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
88 <directive name="sub_filter_once"> |
5a848934a12d
English translation of ngx_http_geoip_module, ngx_http_map_module,
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
89 <syntax><literal>on</literal> | <literal>off</literal></syntax> |
5a848934a12d
English translation of ngx_http_geoip_module, ngx_http_map_module,
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
90 <default>on</default> |
5a848934a12d
English translation of ngx_http_geoip_module, ngx_http_map_module,
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
91 <context>http</context> |
5a848934a12d
English translation of ngx_http_geoip_module, ngx_http_map_module,
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
92 <context>server</context> |
5a848934a12d
English translation of ngx_http_geoip_module, ngx_http_map_module,
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
93 <context>location</context> |
5a848934a12d
English translation of ngx_http_geoip_module, ngx_http_map_module,
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
94 |
5a848934a12d
English translation of ngx_http_geoip_module, ngx_http_map_module,
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
95 <para> |
1555
2a79b38f640b
Sub filter: documented support of multiple strings to replace.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1554
diff
changeset
|
96 Indicates whether to look for each string to replace |
2a79b38f640b
Sub filter: documented support of multiple strings to replace.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1554
diff
changeset
|
97 once or repeatedly. |
348
5a848934a12d
English translation of ngx_http_geoip_module, ngx_http_map_module,
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
98 </para> |
5a848934a12d
English translation of ngx_http_geoip_module, ngx_http_map_module,
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
99 |
5a848934a12d
English translation of ngx_http_geoip_module, ngx_http_map_module,
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
100 </directive> |
5a848934a12d
English translation of ngx_http_geoip_module, ngx_http_map_module,
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
101 |
5a848934a12d
English translation of ngx_http_geoip_module, ngx_http_map_module,
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
102 |
5a848934a12d
English translation of ngx_http_geoip_module, ngx_http_map_module,
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
103 <directive name="sub_filter_types"> |
5a848934a12d
English translation of ngx_http_geoip_module, ngx_http_map_module,
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
104 <syntax><value>mime-type</value> ...</syntax> |
5a848934a12d
English translation of ngx_http_geoip_module, ngx_http_map_module,
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
105 <default>text/html</default> |
5a848934a12d
English translation of ngx_http_geoip_module, ngx_http_map_module,
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
106 <context>http</context> |
5a848934a12d
English translation of ngx_http_geoip_module, ngx_http_map_module,
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
107 <context>server</context> |
5a848934a12d
English translation of ngx_http_geoip_module, ngx_http_map_module,
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
108 <context>location</context> |
5a848934a12d
English translation of ngx_http_geoip_module, ngx_http_map_module,
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
109 |
5a848934a12d
English translation of ngx_http_geoip_module, ngx_http_map_module,
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
110 <para> |
5a848934a12d
English translation of ngx_http_geoip_module, ngx_http_map_module,
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
111 Enables string replacement in responses with the specified MIME types |
5a848934a12d
English translation of ngx_http_geoip_module, ngx_http_map_module,
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
112 in addition to “<literal>text/html</literal>”. |
546
694db9597ee0
Documented the special value "*" in various "*_type" directives.
Ruslan Ermilov <ru@nginx.com>
parents:
348
diff
changeset
|
113 The special value “<literal>*</literal>” matches any MIME type (0.8.29). |
348
5a848934a12d
English translation of ngx_http_geoip_module, ngx_http_map_module,
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
114 </para> |
5a848934a12d
English translation of ngx_http_geoip_module, ngx_http_map_module,
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
115 |
5a848934a12d
English translation of ngx_http_geoip_module, ngx_http_map_module,
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
116 </directive> |
5a848934a12d
English translation of ngx_http_geoip_module, ngx_http_map_module,
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
117 |
5a848934a12d
English translation of ngx_http_geoip_module, ngx_http_map_module,
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
118 </section> |
5a848934a12d
English translation of ngx_http_geoip_module, ngx_http_map_module,
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
119 |
5a848934a12d
English translation of ngx_http_geoip_module, ngx_http_map_module,
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
120 </module> |