Mercurial > hg > nginx-site
annotate xml/en/docs/http/ngx_http_realip_module.xml @ 2582:e162a71453b0
Improved String.prototype.toString() for ordinary strings in njs.
author | Yaroslav Zhuravlev <yar@nginx.com> |
---|---|
date | Tue, 11 Aug 2020 12:34:32 +0100 |
parents | 48ca712794c6 |
children | 4add6ae1296f |
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:
523
diff
changeset
|
3 <!-- |
be54c443235a
Added copyright markers to documentation sources.
Ruslan Ermilov <ru@nginx.com>
parents:
523
diff
changeset
|
4 Copyright (C) Igor Sysoev |
be54c443235a
Added copyright markers to documentation sources.
Ruslan Ermilov <ru@nginx.com>
parents:
523
diff
changeset
|
5 Copyright (C) Nginx, Inc. |
be54c443235a
Added copyright markers to documentation sources.
Ruslan Ermilov <ru@nginx.com>
parents:
523
diff
changeset
|
6 --> |
be54c443235a
Added copyright markers to documentation sources.
Ruslan Ermilov <ru@nginx.com>
parents:
523
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_realip_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_realip_module.html" |
589 | 12 lang="en" |
1985
48ca712794c6
Documented the set_real_ip_from support of hostnames.
Ruslan Ermilov <ru@nginx.com>
parents:
1934
diff
changeset
|
13 rev="8"> |
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> |
966 | 18 The <literal>ngx_http_realip_module</literal> module is used |
1705
f855acbd0a94
Documented the $realip_remote_port variable.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1602
diff
changeset
|
19 to change the client address and optional port |
1933
866653a4f6a2
Verb agreement in the realip module intro.
Sergey Kandaurov <pluknet@nginx.com>
parents:
1923
diff
changeset
|
20 to those sent in the specified header field. |
348
5a848934a12d
English translation of ngx_http_geoip_module, ngx_http_map_module,
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
21 </para> |
5a848934a12d
English translation of ngx_http_geoip_module, ngx_http_map_module,
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
22 |
5a848934a12d
English translation of ngx_http_geoip_module, ngx_http_map_module,
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
23 <para> |
5a848934a12d
English translation of ngx_http_geoip_module, ngx_http_map_module,
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
24 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
|
25 <literal>--with-http_realip_module</literal> |
5a848934a12d
English translation of ngx_http_geoip_module, ngx_http_map_module,
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
26 configuration parameter. |
5a848934a12d
English translation of ngx_http_geoip_module, ngx_http_map_module,
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
27 </para> |
5a848934a12d
English translation of ngx_http_geoip_module, ngx_http_map_module,
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
28 |
5a848934a12d
English translation of ngx_http_geoip_module, ngx_http_map_module,
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
29 </section> |
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 |
5a848934a12d
English translation of ngx_http_geoip_module, ngx_http_map_module,
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
32 <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
|
33 |
5a848934a12d
English translation of ngx_http_geoip_module, ngx_http_map_module,
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
34 <para> |
5a848934a12d
English translation of ngx_http_geoip_module, ngx_http_map_module,
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
35 <example> |
518 | 36 set_real_ip_from 192.168.1.0/24; |
37 set_real_ip_from 192.168.2.1; | |
38 set_real_ip_from 2001:0db8::/32; | |
39 real_ip_header X-Forwarded-For; | |
40 real_ip_recursive on; | |
348
5a848934a12d
English translation of ngx_http_geoip_module, ngx_http_map_module,
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
41 </example> |
5a848934a12d
English translation of ngx_http_geoip_module, ngx_http_map_module,
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
42 </para> |
5a848934a12d
English translation of ngx_http_geoip_module, ngx_http_map_module,
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
43 |
5a848934a12d
English translation of ngx_http_geoip_module, ngx_http_map_module,
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
44 </section> |
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 |
5a848934a12d
English translation of ngx_http_geoip_module, ngx_http_map_module,
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
47 <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
|
48 |
5a848934a12d
English translation of ngx_http_geoip_module, ngx_http_map_module,
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
49 <directive name="set_real_ip_from"> |
468
31e81dcc4ffd
set_real_ip_from: documented the special parameter "unix:".
Ruslan Ermilov <ru@nginx.com>
parents:
364
diff
changeset
|
50 <syntax> |
31e81dcc4ffd
set_real_ip_from: documented the special parameter "unix:".
Ruslan Ermilov <ru@nginx.com>
parents:
364
diff
changeset
|
51 <value>address</value> | |
31e81dcc4ffd
set_real_ip_from: documented the special parameter "unix:".
Ruslan Ermilov <ru@nginx.com>
parents:
364
diff
changeset
|
52 <value>CIDR</value> | |
31e81dcc4ffd
set_real_ip_from: documented the special parameter "unix:".
Ruslan Ermilov <ru@nginx.com>
parents:
364
diff
changeset
|
53 <literal>unix:</literal></syntax> |
348
5a848934a12d
English translation of ngx_http_geoip_module, ngx_http_map_module,
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
54 <default/> |
5a848934a12d
English translation of ngx_http_geoip_module, ngx_http_map_module,
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
55 <context>http</context> |
5a848934a12d
English translation of ngx_http_geoip_module, ngx_http_map_module,
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
56 <context>server</context> |
5a848934a12d
English translation of ngx_http_geoip_module, ngx_http_map_module,
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
57 <context>location</context> |
5a848934a12d
English translation of ngx_http_geoip_module, ngx_http_map_module,
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
58 |
5a848934a12d
English translation of ngx_http_geoip_module, ngx_http_map_module,
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
59 <para> |
518 | 60 Defines trusted addresses that are known to send correct |
348
5a848934a12d
English translation of ngx_http_geoip_module, ngx_http_map_module,
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
61 replacement addresses. |
468
31e81dcc4ffd
set_real_ip_from: documented the special parameter "unix:".
Ruslan Ermilov <ru@nginx.com>
parents:
364
diff
changeset
|
62 If the special value <literal>unix:</literal> is specified, |
31e81dcc4ffd
set_real_ip_from: documented the special parameter "unix:".
Ruslan Ermilov <ru@nginx.com>
parents:
364
diff
changeset
|
63 all UNIX-domain sockets will be trusted. |
1985
48ca712794c6
Documented the set_real_ip_from support of hostnames.
Ruslan Ermilov <ru@nginx.com>
parents:
1934
diff
changeset
|
64 Trusted addresses may also be specified using a hostname (1.13.1). |
518 | 65 <note> |
523 | 66 IPv6 addresses are supported starting from versions 1.3.0 and 1.2.1. |
518 | 67 </note> |
348
5a848934a12d
English translation of ngx_http_geoip_module, ngx_http_map_module,
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
68 </para> |
5a848934a12d
English translation of ngx_http_geoip_module, ngx_http_map_module,
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
69 |
5a848934a12d
English translation of ngx_http_geoip_module, ngx_http_map_module,
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
70 </directive> |
5a848934a12d
English translation of ngx_http_geoip_module, ngx_http_map_module,
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
71 |
5a848934a12d
English translation of ngx_http_geoip_module, ngx_http_map_module,
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
72 |
5a848934a12d
English translation of ngx_http_geoip_module, ngx_http_map_module,
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
73 <directive name="real_ip_header"> |
5a848934a12d
English translation of ngx_http_geoip_module, ngx_http_map_module,
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
74 <syntax> |
364 | 75 <value>field</value> | |
76 <literal>X-Real-IP</literal> | | |
1097
eeb690d4212b
Documented the PROXY protocol support.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
966
diff
changeset
|
77 <literal>X-Forwarded-For</literal> | |
eeb690d4212b
Documented the PROXY protocol support.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
966
diff
changeset
|
78 <literal>proxy_protocol</literal></syntax> |
348
5a848934a12d
English translation of ngx_http_geoip_module, ngx_http_map_module,
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
79 <default>X-Real-IP</default> |
5a848934a12d
English translation of ngx_http_geoip_module, ngx_http_map_module,
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
80 <context>http</context> |
5a848934a12d
English translation of ngx_http_geoip_module, ngx_http_map_module,
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
81 <context>server</context> |
5a848934a12d
English translation of ngx_http_geoip_module, ngx_http_map_module,
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
82 <context>location</context> |
5a848934a12d
English translation of ngx_http_geoip_module, ngx_http_map_module,
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
83 |
5a848934a12d
English translation of ngx_http_geoip_module, ngx_http_map_module,
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
84 <para> |
1523
3b4a86b3515e
Rephrased the "real_ip_header" directive.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1097
diff
changeset
|
85 Defines the request header field |
3b4a86b3515e
Rephrased the "real_ip_header" directive.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1097
diff
changeset
|
86 whose value will be used to replace the client address. |
518 | 87 </para> |
88 | |
1097
eeb690d4212b
Documented the PROXY protocol support.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
966
diff
changeset
|
89 <para> |
1934
a0a64fee6b13
Fixed optional port description in the real_ip_header directive.
Sergey Kandaurov <pluknet@nginx.com>
parents:
1933
diff
changeset
|
90 The request header field value that contains an optional port |
a0a64fee6b13
Fixed optional port description in the real_ip_header directive.
Sergey Kandaurov <pluknet@nginx.com>
parents:
1933
diff
changeset
|
91 is also used to replace the client port (1.11.0). |
1705
f855acbd0a94
Documented the $realip_remote_port variable.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1602
diff
changeset
|
92 The address and port should be specified according to |
1923
66a30a380fba
Fixed links to tools.ietf.org.
Ruslan Ermilov <ru@nginx.com>
parents:
1705
diff
changeset
|
93 <link url="https://tools.ietf.org/html/rfc3986">RFC 3986</link>. |
1705
f855acbd0a94
Documented the $realip_remote_port variable.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1602
diff
changeset
|
94 </para> |
f855acbd0a94
Documented the $realip_remote_port variable.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1602
diff
changeset
|
95 |
f855acbd0a94
Documented the $realip_remote_port variable.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1602
diff
changeset
|
96 <para> |
1097
eeb690d4212b
Documented the PROXY protocol support.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
966
diff
changeset
|
97 The <literal>proxy_protocol</literal> parameter (1.5.12) changes |
eeb690d4212b
Documented the PROXY protocol support.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
966
diff
changeset
|
98 the client address to the one from the PROXY protocol header. |
eeb690d4212b
Documented the PROXY protocol support.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
966
diff
changeset
|
99 The PROXY protocol must be previously enabled by setting the |
eeb690d4212b
Documented the PROXY protocol support.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
966
diff
changeset
|
100 <literal>proxy_protocol</literal> parameter |
eeb690d4212b
Documented the PROXY protocol support.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
966
diff
changeset
|
101 in the <link doc="ngx_http_core_module.xml" id="listen"/> directive. |
eeb690d4212b
Documented the PROXY protocol support.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
966
diff
changeset
|
102 </para> |
eeb690d4212b
Documented the PROXY protocol support.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
966
diff
changeset
|
103 |
518 | 104 </directive> |
105 | |
106 | |
107 <directive name="real_ip_recursive"> | |
108 <syntax><literal>on</literal> | <literal>off</literal></syntax> | |
109 <default>off</default> | |
110 <context>http</context> | |
111 <context>server</context> | |
112 <context>location</context> | |
113 <appeared-in>1.3.0</appeared-in> | |
523 | 114 <appeared-in>1.2.1</appeared-in> |
518 | 115 |
116 <para> | |
701
bff4179d3599
Fixed article upon Andrew Alexeev's suggestion.
Ruslan Ermilov <ru@nginx.com>
parents:
589
diff
changeset
|
117 If recursive search is disabled, the original client address that |
518 | 118 matches one of the trusted addresses is replaced by the last |
119 address sent in the request header field defined by the | |
120 <link id="real_ip_header"/> directive. | |
701
bff4179d3599
Fixed article upon Andrew Alexeev's suggestion.
Ruslan Ermilov <ru@nginx.com>
parents:
589
diff
changeset
|
121 If recursive search is enabled, the original client address that |
518 | 122 matches one of the trusted addresses is replaced by the last |
123 non-trusted address sent in the request header field. | |
348
5a848934a12d
English translation of ngx_http_geoip_module, ngx_http_map_module,
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
124 </para> |
5a848934a12d
English translation of ngx_http_geoip_module, ngx_http_map_module,
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
125 |
5a848934a12d
English translation of ngx_http_geoip_module, ngx_http_map_module,
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
126 </directive> |
5a848934a12d
English translation of ngx_http_geoip_module, ngx_http_map_module,
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
127 |
5a848934a12d
English translation of ngx_http_geoip_module, ngx_http_map_module,
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
128 </section> |
5a848934a12d
English translation of ngx_http_geoip_module, ngx_http_map_module,
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
129 |
1601
8854618e1ca5
Documented the "$realip_remote_addr" variable.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1523
diff
changeset
|
130 |
8854618e1ca5
Documented the "$realip_remote_addr" variable.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1523
diff
changeset
|
131 <section id="variables" name="Embedded Variables"> |
8854618e1ca5
Documented the "$realip_remote_addr" variable.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1523
diff
changeset
|
132 |
8854618e1ca5
Documented the "$realip_remote_addr" variable.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1523
diff
changeset
|
133 <para> |
8854618e1ca5
Documented the "$realip_remote_addr" variable.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1523
diff
changeset
|
134 <list type="tag"> |
8854618e1ca5
Documented the "$realip_remote_addr" variable.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1523
diff
changeset
|
135 |
8854618e1ca5
Documented the "$realip_remote_addr" variable.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1523
diff
changeset
|
136 <tag-name id="var_realip_remote_addr"><var>$realip_remote_addr</var></tag-name> |
8854618e1ca5
Documented the "$realip_remote_addr" variable.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1523
diff
changeset
|
137 <tag-desc> |
1602
bc25f237a966
Removed obsolete dot in $realip_remote_addr.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1601
diff
changeset
|
138 keeps the original client address (1.9.7) |
1601
8854618e1ca5
Documented the "$realip_remote_addr" variable.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1523
diff
changeset
|
139 </tag-desc> |
8854618e1ca5
Documented the "$realip_remote_addr" variable.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1523
diff
changeset
|
140 |
1705
f855acbd0a94
Documented the $realip_remote_port variable.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1602
diff
changeset
|
141 <tag-name id="var_realip_remote_port"><var>$realip_remote_port</var></tag-name> |
f855acbd0a94
Documented the $realip_remote_port variable.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1602
diff
changeset
|
142 <tag-desc> |
f855acbd0a94
Documented the $realip_remote_port variable.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1602
diff
changeset
|
143 keeps the original client port (1.11.0) |
f855acbd0a94
Documented the $realip_remote_port variable.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1602
diff
changeset
|
144 </tag-desc> |
f855acbd0a94
Documented the $realip_remote_port variable.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1602
diff
changeset
|
145 |
1601
8854618e1ca5
Documented the "$realip_remote_addr" variable.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1523
diff
changeset
|
146 </list> |
8854618e1ca5
Documented the "$realip_remote_addr" variable.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1523
diff
changeset
|
147 </para> |
8854618e1ca5
Documented the "$realip_remote_addr" variable.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1523
diff
changeset
|
148 |
8854618e1ca5
Documented the "$realip_remote_addr" variable.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1523
diff
changeset
|
149 </section> |
8854618e1ca5
Documented the "$realip_remote_addr" variable.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1523
diff
changeset
|
150 |
348
5a848934a12d
English translation of ngx_http_geoip_module, ngx_http_map_module,
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
151 </module> |