annotate xml/en/docs/http/ngx_http_geo_module.xml @ 580:be54c443235a

Added copyright markers to documentation sources.
author Ruslan Ermilov <ru@nginx.com>
date Tue, 10 Jul 2012 12:59:42 +0000
parents a8daad8e83bb
children 764fbac1b8b4
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
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"
68d9e5f2ea81 English translation of ngx_http_geo_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
12 lang="en">
68d9e5f2ea81 English translation of ngx_http_geo_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
13
68d9e5f2ea81 English translation of ngx_http_geo_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
14 <section id="summary">
68d9e5f2ea81 English translation of ngx_http_geo_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
15
68d9e5f2ea81 English translation of ngx_http_geo_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
16 <para>
68d9e5f2ea81 English translation of ngx_http_geo_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
17 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
18 whose values depend on the client IP address.
68d9e5f2ea81 English translation of ngx_http_geo_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
19 </para>
68d9e5f2ea81 English translation of ngx_http_geo_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
20
68d9e5f2ea81 English translation of ngx_http_geo_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
21 </section>
68d9e5f2ea81 English translation of ngx_http_geo_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
22
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 <section id="example" name="Example Configuration">
68d9e5f2ea81 English translation of ngx_http_geo_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
25
68d9e5f2ea81 English translation of ngx_http_geo_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
26 <para>
68d9e5f2ea81 English translation of ngx_http_geo_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
27 <example>
68d9e5f2ea81 English translation of ngx_http_geo_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
28 geo $geo {
68d9e5f2ea81 English translation of ngx_http_geo_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
29 default 0;
68d9e5f2ea81 English translation of ngx_http_geo_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
30 127.0.0.1/32 2;
68d9e5f2ea81 English translation of ngx_http_geo_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
31 192.168.1.0/24 1;
68d9e5f2ea81 English translation of ngx_http_geo_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
32 10.1.0.0/16 1;
68d9e5f2ea81 English translation of ngx_http_geo_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
33 }
68d9e5f2ea81 English translation of ngx_http_geo_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
34 </example>
68d9e5f2ea81 English translation of ngx_http_geo_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
35 </para>
68d9e5f2ea81 English translation of ngx_http_geo_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
36
68d9e5f2ea81 English translation of ngx_http_geo_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
37 </section>
68d9e5f2ea81 English translation of ngx_http_geo_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
38
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 <section id="directives" name="Directives">
68d9e5f2ea81 English translation of ngx_http_geo_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
41
68d9e5f2ea81 English translation of ngx_http_geo_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
42 <directive name="geo">
68d9e5f2ea81 English translation of ngx_http_geo_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
43 <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
44 <default/>
68d9e5f2ea81 English translation of ngx_http_geo_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
45 <context>http</context>
68d9e5f2ea81 English translation of ngx_http_geo_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
46
68d9e5f2ea81 English translation of ngx_http_geo_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
47 <para>
68d9e5f2ea81 English translation of ngx_http_geo_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
48 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
49 on the client IP address.
68d9e5f2ea81 English translation of ngx_http_geo_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
50 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
51 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
52 <example>
68d9e5f2ea81 English translation of ngx_http_geo_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
53 geo $arg_remote_addr $geo {
68d9e5f2ea81 English translation of ngx_http_geo_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
54 ...;
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 </example>
68d9e5f2ea81 English translation of ngx_http_geo_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
57 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
58 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
59 </para>
68d9e5f2ea81 English translation of ngx_http_geo_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
60
68d9e5f2ea81 English translation of ngx_http_geo_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
61 <para>
68d9e5f2ea81 English translation of ngx_http_geo_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
62 Addresses are specified as CIDR or ranges (0.7.23).
518
65750bdde8fb Documented recent changes.
Ruslan Ermilov <ru@nginx.com>
parents: 369
diff changeset
63 The following special parameters are also supported:
369
68d9e5f2ea81 English translation of ngx_http_geo_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
64 <list type="tag">
68d9e5f2ea81 English translation of ngx_http_geo_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
65
68d9e5f2ea81 English translation of ngx_http_geo_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
66 <tag-name><literal>delete</literal></tag-name>
68d9e5f2ea81 English translation of ngx_http_geo_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
67 <tag-desc>
68d9e5f2ea81 English translation of ngx_http_geo_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
68 deletes the specified network (0.7.23).
68d9e5f2ea81 English translation of ngx_http_geo_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
69 </tag-desc>
68d9e5f2ea81 English translation of ngx_http_geo_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
70
68d9e5f2ea81 English translation of ngx_http_geo_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
71 <tag-name><literal>default</literal></tag-name>
68d9e5f2ea81 English translation of ngx_http_geo_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
72 <tag-desc>
68d9e5f2ea81 English translation of ngx_http_geo_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
73 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
74 match any of the specified addresses.
68d9e5f2ea81 English translation of ngx_http_geo_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
75 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
76 instead of <literal>default</literal>.
68d9e5f2ea81 English translation of ngx_http_geo_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
77 </tag-desc>
68d9e5f2ea81 English translation of ngx_http_geo_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
78
68d9e5f2ea81 English translation of ngx_http_geo_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
79 <tag-name><literal>include</literal></tag-name>
68d9e5f2ea81 English translation of ngx_http_geo_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
80 <tag-desc>
68d9e5f2ea81 English translation of ngx_http_geo_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
81 includes a file with addresses and values.
68d9e5f2ea81 English translation of ngx_http_geo_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
82 There can be several inclusions.
68d9e5f2ea81 English translation of ngx_http_geo_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
83 </tag-desc>
68d9e5f2ea81 English translation of ngx_http_geo_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
84
68d9e5f2ea81 English translation of ngx_http_geo_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
85 <tag-name><literal>proxy</literal></tag-name>
68d9e5f2ea81 English translation of ngx_http_geo_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
86 <tag-desc>
518
65750bdde8fb Documented recent changes.
Ruslan Ermilov <ru@nginx.com>
parents: 369
diff changeset
87 defines trusted addresses (0.8.7, 0.7.63).
65750bdde8fb Documented recent changes.
Ruslan Ermilov <ru@nginx.com>
parents: 369
diff changeset
88 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
89 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
90 header field will be used instead.
518
65750bdde8fb Documented recent changes.
Ruslan Ermilov <ru@nginx.com>
parents: 369
diff changeset
91 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
92 checked sequentially.
518
65750bdde8fb Documented recent changes.
Ruslan Ermilov <ru@nginx.com>
parents: 369
diff changeset
93 <note>
523
a8daad8e83bb Documented 1.2.1 changes.
Ruslan Ermilov <ru@nginx.com>
parents: 518
diff changeset
94 IPv6 addresses are supported starting from versions 1.3.0 and 1.2.1.
518
65750bdde8fb Documented recent changes.
Ruslan Ermilov <ru@nginx.com>
parents: 369
diff changeset
95 </note>
65750bdde8fb Documented recent changes.
Ruslan Ermilov <ru@nginx.com>
parents: 369
diff changeset
96 </tag-desc>
65750bdde8fb Documented recent changes.
Ruslan Ermilov <ru@nginx.com>
parents: 369
diff changeset
97
65750bdde8fb Documented recent changes.
Ruslan Ermilov <ru@nginx.com>
parents: 369
diff changeset
98 <tag-name><literal>proxy_recursive</literal></tag-name>
65750bdde8fb Documented recent changes.
Ruslan Ermilov <ru@nginx.com>
parents: 369
diff changeset
99 <tag-desc>
523
a8daad8e83bb Documented 1.2.1 changes.
Ruslan Ermilov <ru@nginx.com>
parents: 518
diff changeset
100 enables recursive address search (1.3.0, 1.2.1).
518
65750bdde8fb Documented recent changes.
Ruslan Ermilov <ru@nginx.com>
parents: 369
diff changeset
101 If recursive search is disabled then instead of an original client
65750bdde8fb Documented recent changes.
Ruslan Ermilov <ru@nginx.com>
parents: 369
diff changeset
102 address that matches one of the trusted addresses, the last
65750bdde8fb Documented recent changes.
Ruslan Ermilov <ru@nginx.com>
parents: 369
diff changeset
103 address sent in <header>X-Forwarded-For</header> will be used.
65750bdde8fb Documented recent changes.
Ruslan Ermilov <ru@nginx.com>
parents: 369
diff changeset
104 If recursive search is enabled then instead an original client
65750bdde8fb Documented recent changes.
Ruslan Ermilov <ru@nginx.com>
parents: 369
diff changeset
105 address that matches one of the trusted addresses, the last
65750bdde8fb Documented recent changes.
Ruslan Ermilov <ru@nginx.com>
parents: 369
diff changeset
106 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
107 </tag-desc>
68d9e5f2ea81 English translation of ngx_http_geo_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
108
68d9e5f2ea81 English translation of ngx_http_geo_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
109 <tag-name><literal>ranges</literal></tag-name>
68d9e5f2ea81 English translation of ngx_http_geo_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
110 <tag-desc>
68d9e5f2ea81 English translation of ngx_http_geo_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
111 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
112 This parameter should be the first.
68d9e5f2ea81 English translation of ngx_http_geo_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
113 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
114 </tag-desc>
68d9e5f2ea81 English translation of ngx_http_geo_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
115
68d9e5f2ea81 English translation of ngx_http_geo_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
116 </list>
68d9e5f2ea81 English translation of ngx_http_geo_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
117 </para>
68d9e5f2ea81 English translation of ngx_http_geo_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
118
68d9e5f2ea81 English translation of ngx_http_geo_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
119 <para>
68d9e5f2ea81 English translation of ngx_http_geo_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
120 Example:
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 geo $country {
68d9e5f2ea81 English translation of ngx_http_geo_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
123 default ZZ;
68d9e5f2ea81 English translation of ngx_http_geo_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
124 include conf/geo.conf;
68d9e5f2ea81 English translation of ngx_http_geo_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
125 delete 127.0.0.0/16;
68d9e5f2ea81 English translation of ngx_http_geo_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
126 proxy 192.168.100.0/24;
518
65750bdde8fb Documented recent changes.
Ruslan Ermilov <ru@nginx.com>
parents: 369
diff changeset
127 proxy 2001:0db8::/32;
369
68d9e5f2ea81 English translation of ngx_http_geo_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
128
68d9e5f2ea81 English translation of ngx_http_geo_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
129 127.0.0.0/24 US;
68d9e5f2ea81 English translation of ngx_http_geo_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
130 127.0.0.1/32 RU;
68d9e5f2ea81 English translation of ngx_http_geo_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
131 10.1.0.0/16 RU;
68d9e5f2ea81 English translation of ngx_http_geo_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
132 192.168.1.0/24 UK;
68d9e5f2ea81 English translation of ngx_http_geo_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
133 }
68d9e5f2ea81 English translation of ngx_http_geo_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
134 </example>
68d9e5f2ea81 English translation of ngx_http_geo_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
135 </para>
68d9e5f2ea81 English translation of ngx_http_geo_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
136
68d9e5f2ea81 English translation of ngx_http_geo_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
137 <para>
68d9e5f2ea81 English translation of ngx_http_geo_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
138 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
139 <example>
68d9e5f2ea81 English translation of ngx_http_geo_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
140 10.2.0.0/16 RU;
68d9e5f2ea81 English translation of ngx_http_geo_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
141 192.168.2.0/24 RU;
68d9e5f2ea81 English translation of ngx_http_geo_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
142 </example>
68d9e5f2ea81 English translation of ngx_http_geo_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
143 </para>
68d9e5f2ea81 English translation of ngx_http_geo_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
144
68d9e5f2ea81 English translation of ngx_http_geo_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
145 <para>
68d9e5f2ea81 English translation of ngx_http_geo_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
146 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
147 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
148 will be chosen, not “<literal>US</literal>”.
68d9e5f2ea81 English translation of ngx_http_geo_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
149 </para>
68d9e5f2ea81 English translation of ngx_http_geo_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
150
68d9e5f2ea81 English translation of ngx_http_geo_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
151 <para>
68d9e5f2ea81 English translation of ngx_http_geo_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
152 Example with ranges:
68d9e5f2ea81 English translation of ngx_http_geo_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
153 <example>
68d9e5f2ea81 English translation of ngx_http_geo_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
154 geo $country {
68d9e5f2ea81 English translation of ngx_http_geo_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
155 ranges;
68d9e5f2ea81 English translation of ngx_http_geo_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
156 default ZZ;
68d9e5f2ea81 English translation of ngx_http_geo_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
157 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
158 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
159 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
160 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
161 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
162 }
68d9e5f2ea81 English translation of ngx_http_geo_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
163 </example>
68d9e5f2ea81 English translation of ngx_http_geo_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
164 </para>
68d9e5f2ea81 English translation of ngx_http_geo_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
165
68d9e5f2ea81 English translation of ngx_http_geo_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
166 </directive>
68d9e5f2ea81 English translation of ngx_http_geo_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
167
68d9e5f2ea81 English translation of ngx_http_geo_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
168 </section>
68d9e5f2ea81 English translation of ngx_http_geo_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
169
68d9e5f2ea81 English translation of ngx_http_geo_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
170 </module>