Mercurial > hg > nginx-site
annotate xml/en/docs/http/ngx_http_sub_module.xml @ 2960:fed0092ee554
Added info about the Unit 1.30.0 release.
author | Artem Konev <artem.konev@nginx.com> |
---|---|
date | Wed, 10 May 2023 20:26:21 +0100 |
parents | eeed494bba51 |
children |
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" |
2593
eeed494bba51
Unified phrases about configuration levels and inheritance.
Ruslan Ermilov <ru@nginx.com>
parents:
1807
diff
changeset
|
13 rev="6"> |
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 |
2593
eeed494bba51
Unified phrases about configuration levels and inheritance.
Ruslan Ermilov <ru@nginx.com>
parents:
1807
diff
changeset
|
60 can be specified on the same configuration level (1.9.4). |
eeed494bba51
Unified phrases about configuration levels and inheritance.
Ruslan Ermilov <ru@nginx.com>
parents:
1807
diff
changeset
|
61 These directives are inherited from the previous configuration level |
eeed494bba51
Unified phrases about configuration levels and inheritance.
Ruslan Ermilov <ru@nginx.com>
parents:
1807
diff
changeset
|
62 if and only if there are no <literal>sub_filter</literal> directives |
eeed494bba51
Unified phrases about configuration levels and inheritance.
Ruslan Ermilov <ru@nginx.com>
parents:
1807
diff
changeset
|
63 defined on the current level. |
348
5a848934a12d
English translation of ngx_http_geoip_module, ngx_http_map_module,
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
64 </para> |
5a848934a12d
English translation of ngx_http_geoip_module, ngx_http_map_module,
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
65 |
5a848934a12d
English translation of ngx_http_geoip_module, ngx_http_map_module,
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
66 </directive> |
5a848934a12d
English translation of ngx_http_geoip_module, ngx_http_map_module,
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
67 |
5a848934a12d
English translation of ngx_http_geoip_module, ngx_http_map_module,
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
68 |
918
ae785c6aaa91
Documented ssi/sub_filter/xslt_last_modified.
Maxim Dounin <mdounin@mdounin.ru>
parents:
589
diff
changeset
|
69 <directive name="sub_filter_last_modified"> |
ae785c6aaa91
Documented ssi/sub_filter/xslt_last_modified.
Maxim Dounin <mdounin@mdounin.ru>
parents:
589
diff
changeset
|
70 <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
|
71 <default>off</default> |
ae785c6aaa91
Documented ssi/sub_filter/xslt_last_modified.
Maxim Dounin <mdounin@mdounin.ru>
parents:
589
diff
changeset
|
72 <context>http</context> |
ae785c6aaa91
Documented ssi/sub_filter/xslt_last_modified.
Maxim Dounin <mdounin@mdounin.ru>
parents:
589
diff
changeset
|
73 <context>server</context> |
ae785c6aaa91
Documented ssi/sub_filter/xslt_last_modified.
Maxim Dounin <mdounin@mdounin.ru>
parents:
589
diff
changeset
|
74 <context>location</context> |
ae785c6aaa91
Documented ssi/sub_filter/xslt_last_modified.
Maxim Dounin <mdounin@mdounin.ru>
parents:
589
diff
changeset
|
75 <appeared-in>1.5.1</appeared-in> |
ae785c6aaa91
Documented ssi/sub_filter/xslt_last_modified.
Maxim Dounin <mdounin@mdounin.ru>
parents:
589
diff
changeset
|
76 |
ae785c6aaa91
Documented ssi/sub_filter/xslt_last_modified.
Maxim Dounin <mdounin@mdounin.ru>
parents:
589
diff
changeset
|
77 <para> |
966 | 78 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
|
79 from the original response during replacement |
ae785c6aaa91
Documented ssi/sub_filter/xslt_last_modified.
Maxim Dounin <mdounin@mdounin.ru>
parents:
589
diff
changeset
|
80 to facilitate response caching. |
ae785c6aaa91
Documented ssi/sub_filter/xslt_last_modified.
Maxim Dounin <mdounin@mdounin.ru>
parents:
589
diff
changeset
|
81 </para> |
ae785c6aaa91
Documented ssi/sub_filter/xslt_last_modified.
Maxim Dounin <mdounin@mdounin.ru>
parents:
589
diff
changeset
|
82 |
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 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
|
85 are modified during processing. |
ae785c6aaa91
Documented ssi/sub_filter/xslt_last_modified.
Maxim Dounin <mdounin@mdounin.ru>
parents:
589
diff
changeset
|
86 </para> |
ae785c6aaa91
Documented ssi/sub_filter/xslt_last_modified.
Maxim Dounin <mdounin@mdounin.ru>
parents:
589
diff
changeset
|
87 |
ae785c6aaa91
Documented ssi/sub_filter/xslt_last_modified.
Maxim Dounin <mdounin@mdounin.ru>
parents:
589
diff
changeset
|
88 </directive> |
ae785c6aaa91
Documented ssi/sub_filter/xslt_last_modified.
Maxim Dounin <mdounin@mdounin.ru>
parents:
589
diff
changeset
|
89 |
ae785c6aaa91
Documented ssi/sub_filter/xslt_last_modified.
Maxim Dounin <mdounin@mdounin.ru>
parents:
589
diff
changeset
|
90 |
348
5a848934a12d
English translation of ngx_http_geoip_module, ngx_http_map_module,
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
91 <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
|
92 <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
|
93 <default>on</default> |
5a848934a12d
English translation of ngx_http_geoip_module, ngx_http_map_module,
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
94 <context>http</context> |
5a848934a12d
English translation of ngx_http_geoip_module, ngx_http_map_module,
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
95 <context>server</context> |
5a848934a12d
English translation of ngx_http_geoip_module, ngx_http_map_module,
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
96 <context>location</context> |
5a848934a12d
English translation of ngx_http_geoip_module, ngx_http_map_module,
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
97 |
5a848934a12d
English translation of ngx_http_geoip_module, ngx_http_map_module,
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
98 <para> |
1555
2a79b38f640b
Sub filter: documented support of multiple strings to replace.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1554
diff
changeset
|
99 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
|
100 once or repeatedly. |
348
5a848934a12d
English translation of ngx_http_geoip_module, ngx_http_map_module,
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
101 </para> |
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> |
5a848934a12d
English translation of ngx_http_geoip_module, ngx_http_map_module,
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
104 |
5a848934a12d
English translation of ngx_http_geoip_module, ngx_http_map_module,
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
105 |
5a848934a12d
English translation of ngx_http_geoip_module, ngx_http_map_module,
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
106 <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
|
107 <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
|
108 <default>text/html</default> |
5a848934a12d
English translation of ngx_http_geoip_module, ngx_http_map_module,
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
109 <context>http</context> |
5a848934a12d
English translation of ngx_http_geoip_module, ngx_http_map_module,
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
110 <context>server</context> |
5a848934a12d
English translation of ngx_http_geoip_module, ngx_http_map_module,
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
111 <context>location</context> |
5a848934a12d
English translation of ngx_http_geoip_module, ngx_http_map_module,
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
112 |
5a848934a12d
English translation of ngx_http_geoip_module, ngx_http_map_module,
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
113 <para> |
5a848934a12d
English translation of ngx_http_geoip_module, ngx_http_map_module,
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
114 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
|
115 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
|
116 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
|
117 </para> |
5a848934a12d
English translation of ngx_http_geoip_module, ngx_http_map_module,
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
118 |
5a848934a12d
English translation of ngx_http_geoip_module, ngx_http_map_module,
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
119 </directive> |
5a848934a12d
English translation of ngx_http_geoip_module, ngx_http_map_module,
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
120 |
5a848934a12d
English translation of ngx_http_geoip_module, ngx_http_map_module,
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
121 </section> |
5a848934a12d
English translation of ngx_http_geoip_module, ngx_http_map_module,
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
122 |
5a848934a12d
English translation of ngx_http_geoip_module, ngx_http_map_module,
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
123 </module> |