Mercurial > hg > nginx-site
annotate xml/en/docs/http/ngx_http_geo_module.xml @ 608:34b0e74528a5
Regenerated.
author | Ruslan Ermilov <ru@nginx.com> |
---|---|
date | Thu, 26 Jul 2012 11:37:10 +0000 |
parents | 764fbac1b8b4 |
children | ec33576efaa5 |
rev | line source |
---|---|
369
68d9e5f2ea81
English translation of ngx_http_geo_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
1 <?xml version="1.0"?> |
68d9e5f2ea81
English translation of ngx_http_geo_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 |
369
68d9e5f2ea81
English translation of ngx_http_geo_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
8 <!DOCTYPE module SYSTEM "../../../../dtd/module.dtd"> |
68d9e5f2ea81
English translation of ngx_http_geo_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
9 |
68d9e5f2ea81
English translation of ngx_http_geo_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
10 <module name="Module ngx_http_geo_module" |
68d9e5f2ea81
English translation of ngx_http_geo_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
11 link="/en/docs/http/ngx_http_geo_module.html" |
589 | 12 lang="en" |
13 rev="1"> | |
369
68d9e5f2ea81
English translation of ngx_http_geo_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
14 |
68d9e5f2ea81
English translation of ngx_http_geo_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
15 <section id="summary"> |
68d9e5f2ea81
English translation of ngx_http_geo_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
16 |
68d9e5f2ea81
English translation of ngx_http_geo_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
17 <para> |
68d9e5f2ea81
English translation of ngx_http_geo_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
18 The <literal>ngx_http_geo_module</literal> module creates variables |
68d9e5f2ea81
English translation of ngx_http_geo_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
19 whose values depend on the client IP address. |
68d9e5f2ea81
English translation of ngx_http_geo_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
20 </para> |
68d9e5f2ea81
English translation of ngx_http_geo_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
21 |
68d9e5f2ea81
English translation of ngx_http_geo_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
22 </section> |
68d9e5f2ea81
English translation of ngx_http_geo_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
23 |
68d9e5f2ea81
English translation of ngx_http_geo_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
24 |
68d9e5f2ea81
English translation of ngx_http_geo_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
25 <section id="example" name="Example Configuration"> |
68d9e5f2ea81
English translation of ngx_http_geo_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
26 |
68d9e5f2ea81
English translation of ngx_http_geo_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
27 <para> |
68d9e5f2ea81
English translation of ngx_http_geo_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
28 <example> |
68d9e5f2ea81
English translation of ngx_http_geo_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
29 geo $geo { |
68d9e5f2ea81
English translation of ngx_http_geo_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
30 default 0; |
68d9e5f2ea81
English translation of ngx_http_geo_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
31 127.0.0.1/32 2; |
68d9e5f2ea81
English translation of ngx_http_geo_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
32 192.168.1.0/24 1; |
68d9e5f2ea81
English translation of ngx_http_geo_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
33 10.1.0.0/16 1; |
68d9e5f2ea81
English translation of ngx_http_geo_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
34 } |
68d9e5f2ea81
English translation of ngx_http_geo_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
35 </example> |
68d9e5f2ea81
English translation of ngx_http_geo_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
36 </para> |
68d9e5f2ea81
English translation of ngx_http_geo_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
37 |
68d9e5f2ea81
English translation of ngx_http_geo_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
38 </section> |
68d9e5f2ea81
English translation of ngx_http_geo_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
39 |
68d9e5f2ea81
English translation of ngx_http_geo_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
40 |
68d9e5f2ea81
English translation of ngx_http_geo_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
41 <section id="directives" name="Directives"> |
68d9e5f2ea81
English translation of ngx_http_geo_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
42 |
68d9e5f2ea81
English translation of ngx_http_geo_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
43 <directive name="geo"> |
68d9e5f2ea81
English translation of ngx_http_geo_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
44 <syntax block="yes">[<value>$address</value>] <value>$variable</value></syntax> |
68d9e5f2ea81
English translation of ngx_http_geo_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
45 <default/> |
68d9e5f2ea81
English translation of ngx_http_geo_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
46 <context>http</context> |
68d9e5f2ea81
English translation of ngx_http_geo_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
47 |
68d9e5f2ea81
English translation of ngx_http_geo_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
48 <para> |
68d9e5f2ea81
English translation of ngx_http_geo_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
49 Describes the dependency of values of the specified variable |
68d9e5f2ea81
English translation of ngx_http_geo_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
50 on the client IP address. |
68d9e5f2ea81
English translation of ngx_http_geo_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
51 By default an address is taken from the <var>$remote_addr</var> variable |
68d9e5f2ea81
English translation of ngx_http_geo_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
52 but it can also be taken from another variable (0.7.27), for example: |
68d9e5f2ea81
English translation of ngx_http_geo_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
53 <example> |
68d9e5f2ea81
English translation of ngx_http_geo_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
54 geo $arg_remote_addr $geo { |
68d9e5f2ea81
English translation of ngx_http_geo_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
55 ...; |
68d9e5f2ea81
English translation of ngx_http_geo_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
56 } |
68d9e5f2ea81
English translation of ngx_http_geo_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
57 </example> |
68d9e5f2ea81
English translation of ngx_http_geo_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
58 If the value of a variable does not represent a valid IP address |
68d9e5f2ea81
English translation of ngx_http_geo_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
59 then the “<literal>255.255.255.255</literal>” address is used. |
68d9e5f2ea81
English translation of ngx_http_geo_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
60 </para> |
68d9e5f2ea81
English translation of ngx_http_geo_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
61 |
68d9e5f2ea81
English translation of ngx_http_geo_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
62 <para> |
68d9e5f2ea81
English translation of ngx_http_geo_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
63 Addresses are specified as CIDR or ranges (0.7.23). |
518 | 64 The following special parameters are also supported: |
369
68d9e5f2ea81
English translation of ngx_http_geo_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
65 <list type="tag"> |
68d9e5f2ea81
English translation of ngx_http_geo_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
66 |
68d9e5f2ea81
English translation of ngx_http_geo_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
67 <tag-name><literal>delete</literal></tag-name> |
68d9e5f2ea81
English translation of ngx_http_geo_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
68 <tag-desc> |
68d9e5f2ea81
English translation of ngx_http_geo_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
69 deletes the specified network (0.7.23). |
68d9e5f2ea81
English translation of ngx_http_geo_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
70 </tag-desc> |
68d9e5f2ea81
English translation of ngx_http_geo_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
71 |
68d9e5f2ea81
English translation of ngx_http_geo_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
72 <tag-name><literal>default</literal></tag-name> |
68d9e5f2ea81
English translation of ngx_http_geo_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
73 <tag-desc> |
68d9e5f2ea81
English translation of ngx_http_geo_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
74 a value of variable if the client address does not |
68d9e5f2ea81
English translation of ngx_http_geo_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
75 match any of the specified addresses. |
68d9e5f2ea81
English translation of ngx_http_geo_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
76 When CIDR is used, “<literal>0.0.0.0/0</literal>” can be written |
68d9e5f2ea81
English translation of ngx_http_geo_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
77 instead of <literal>default</literal>. |
68d9e5f2ea81
English translation of ngx_http_geo_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
78 </tag-desc> |
68d9e5f2ea81
English translation of ngx_http_geo_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
79 |
68d9e5f2ea81
English translation of ngx_http_geo_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
80 <tag-name><literal>include</literal></tag-name> |
68d9e5f2ea81
English translation of ngx_http_geo_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
81 <tag-desc> |
68d9e5f2ea81
English translation of ngx_http_geo_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
82 includes a file with addresses and values. |
68d9e5f2ea81
English translation of ngx_http_geo_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
83 There can be several inclusions. |
68d9e5f2ea81
English translation of ngx_http_geo_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
84 </tag-desc> |
68d9e5f2ea81
English translation of ngx_http_geo_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
85 |
68d9e5f2ea81
English translation of ngx_http_geo_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
86 <tag-name><literal>proxy</literal></tag-name> |
68d9e5f2ea81
English translation of ngx_http_geo_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
87 <tag-desc> |
518 | 88 defines trusted addresses (0.8.7, 0.7.63). |
89 When a request comes from a trusted address, | |
369
68d9e5f2ea81
English translation of ngx_http_geo_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
90 an address from the <header>X-Forwarded-For</header> request |
68d9e5f2ea81
English translation of ngx_http_geo_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
91 header field will be used instead. |
518 | 92 In contrast to the regular addresses, trusted addresses are |
369
68d9e5f2ea81
English translation of ngx_http_geo_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
93 checked sequentially. |
518 | 94 <note> |
523 | 95 IPv6 addresses are supported starting from versions 1.3.0 and 1.2.1. |
518 | 96 </note> |
97 </tag-desc> | |
98 | |
99 <tag-name><literal>proxy_recursive</literal></tag-name> | |
100 <tag-desc> | |
523 | 101 enables recursive address search (1.3.0, 1.2.1). |
518 | 102 If recursive search is disabled then instead of an original client |
103 address that matches one of the trusted addresses, the last | |
104 address sent in <header>X-Forwarded-For</header> will be used. | |
105 If recursive search is enabled then instead an original client | |
106 address that matches one of the trusted addresses, the last | |
107 non-trusted address sent in <header>X-Forwarded-For</header> will be used. | |
369
68d9e5f2ea81
English translation of ngx_http_geo_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
108 </tag-desc> |
68d9e5f2ea81
English translation of ngx_http_geo_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
109 |
68d9e5f2ea81
English translation of ngx_http_geo_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
110 <tag-name><literal>ranges</literal></tag-name> |
68d9e5f2ea81
English translation of ngx_http_geo_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
111 <tag-desc> |
68d9e5f2ea81
English translation of ngx_http_geo_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
112 indicates that addresses are specified as ranges (0.7.23). |
68d9e5f2ea81
English translation of ngx_http_geo_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
113 This parameter should be the first. |
68d9e5f2ea81
English translation of ngx_http_geo_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
114 To speed up loading of a geo base, addresses should be put in increasing order. |
68d9e5f2ea81
English translation of ngx_http_geo_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
115 </tag-desc> |
68d9e5f2ea81
English translation of ngx_http_geo_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
116 |
68d9e5f2ea81
English translation of ngx_http_geo_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
117 </list> |
68d9e5f2ea81
English translation of ngx_http_geo_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
118 </para> |
68d9e5f2ea81
English translation of ngx_http_geo_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
119 |
68d9e5f2ea81
English translation of ngx_http_geo_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
120 <para> |
68d9e5f2ea81
English translation of ngx_http_geo_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
121 Example: |
68d9e5f2ea81
English translation of ngx_http_geo_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
122 <example> |
68d9e5f2ea81
English translation of ngx_http_geo_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
123 geo $country { |
68d9e5f2ea81
English translation of ngx_http_geo_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
124 default ZZ; |
68d9e5f2ea81
English translation of ngx_http_geo_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
125 include conf/geo.conf; |
68d9e5f2ea81
English translation of ngx_http_geo_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
126 delete 127.0.0.0/16; |
68d9e5f2ea81
English translation of ngx_http_geo_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
127 proxy 192.168.100.0/24; |
518 | 128 proxy 2001:0db8::/32; |
369
68d9e5f2ea81
English translation of ngx_http_geo_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
129 |
68d9e5f2ea81
English translation of ngx_http_geo_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
130 127.0.0.0/24 US; |
68d9e5f2ea81
English translation of ngx_http_geo_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
131 127.0.0.1/32 RU; |
68d9e5f2ea81
English translation of ngx_http_geo_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
132 10.1.0.0/16 RU; |
68d9e5f2ea81
English translation of ngx_http_geo_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
133 192.168.1.0/24 UK; |
68d9e5f2ea81
English translation of ngx_http_geo_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
134 } |
68d9e5f2ea81
English translation of ngx_http_geo_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
135 </example> |
68d9e5f2ea81
English translation of ngx_http_geo_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
136 </para> |
68d9e5f2ea81
English translation of ngx_http_geo_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
137 |
68d9e5f2ea81
English translation of ngx_http_geo_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
138 <para> |
68d9e5f2ea81
English translation of ngx_http_geo_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
139 The <path>conf/geo.conf</path> file could contain the following lines: |
68d9e5f2ea81
English translation of ngx_http_geo_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
140 <example> |
68d9e5f2ea81
English translation of ngx_http_geo_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
141 10.2.0.0/16 RU; |
68d9e5f2ea81
English translation of ngx_http_geo_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
142 192.168.2.0/24 RU; |
68d9e5f2ea81
English translation of ngx_http_geo_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
143 </example> |
68d9e5f2ea81
English translation of ngx_http_geo_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
144 </para> |
68d9e5f2ea81
English translation of ngx_http_geo_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
145 |
68d9e5f2ea81
English translation of ngx_http_geo_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
146 <para> |
68d9e5f2ea81
English translation of ngx_http_geo_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
147 A value of the most specific match is used. |
68d9e5f2ea81
English translation of ngx_http_geo_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
148 For example, for the 127.0.0.1 address the value “<literal>RU</literal>” |
68d9e5f2ea81
English translation of ngx_http_geo_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
149 will be chosen, not “<literal>US</literal>”. |
68d9e5f2ea81
English translation of ngx_http_geo_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
150 </para> |
68d9e5f2ea81
English translation of ngx_http_geo_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
151 |
68d9e5f2ea81
English translation of ngx_http_geo_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
152 <para> |
68d9e5f2ea81
English translation of ngx_http_geo_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
153 Example with ranges: |
68d9e5f2ea81
English translation of ngx_http_geo_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
154 <example> |
68d9e5f2ea81
English translation of ngx_http_geo_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
155 geo $country { |
68d9e5f2ea81
English translation of ngx_http_geo_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
156 ranges; |
68d9e5f2ea81
English translation of ngx_http_geo_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
157 default ZZ; |
68d9e5f2ea81
English translation of ngx_http_geo_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
158 127.0.0.0-127.0.0.0 US; |
68d9e5f2ea81
English translation of ngx_http_geo_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
159 127.0.0.1-127.0.0.1 RU; |
68d9e5f2ea81
English translation of ngx_http_geo_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
160 127.0.0.1-127.0.0.255 US; |
68d9e5f2ea81
English translation of ngx_http_geo_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
161 10.1.0.0-10.1.255.255 RU; |
68d9e5f2ea81
English translation of ngx_http_geo_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
162 192.168.1.0-192.168.1.255 UK; |
68d9e5f2ea81
English translation of ngx_http_geo_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
163 } |
68d9e5f2ea81
English translation of ngx_http_geo_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
164 </example> |
68d9e5f2ea81
English translation of ngx_http_geo_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
165 </para> |
68d9e5f2ea81
English translation of ngx_http_geo_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
166 |
68d9e5f2ea81
English translation of ngx_http_geo_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
167 </directive> |
68d9e5f2ea81
English translation of ngx_http_geo_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
168 |
68d9e5f2ea81
English translation of ngx_http_geo_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
169 </section> |
68d9e5f2ea81
English translation of ngx_http_geo_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
170 |
68d9e5f2ea81
English translation of ngx_http_geo_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
171 </module> |