comparison xml/cn/docs/http/ngx_http_geoip_module.xml @ 792:ceb8a4e374b7

Updated the Chinese documentation.
author Ruslan Ermilov <ru@nginx.com>
date Tue, 25 Dec 2012 06:34:37 +0000
parents
children
comparison
equal deleted inserted replaced
791:15f2bab0740d 792:ceb8a4e374b7
1 <?xml version="1.0"?>
2
3 <!--
4 Copyright (C) Igor Sysoev
5 Copyright (C) Nginx, Inc.
6 -->
7
8 <!DOCTYPE module SYSTEM "../../../../dtd/module.dtd">
9
10 <module name="ngx_http_geoip_module 模块"
11 link="/cn/docs/http/ngx_http_geoip_module.html"
12 lang="cn"
13 translator="cfsego"
14 rev="1">
15
16 <section id="summary">
17
18 <para>
19 <literal>ngx_http_geoip_module</literal> 模块(0.8.6+)创建变量,使用预编译的<link url="http://www.maxmind.com">MaxMind</link>数据库解析客户端IP地址,得到变量值。
20 </para>
21
22 <para>
23 nginx默认不编译这个模块,需要开启<literal>--with-http_geoip_module</literal>编译选项。
24 <note>
25 模块依赖<link url="http://www.maxmind.com/app/c">MaxMind GeoIP</link>库。
26 </note>
27 </para>
28
29 </section>
30
31
32 <section id="example" name="配置示例">
33
34 <para>
35 <example>
36 http {
37 geoip_country GeoIP.dat;
38 geoip_city GeoLiteCity.dat;
39 geoip_proxy 192.168.100.0/24;
40 geoip_proxy 2001:0db8::/32;
41 geoip_proxy_recursive on;
42 ...
43 </example>
44 </para>
45
46 </section>
47
48
49 <section id="directives" name="指令">
50
51 <directive name="geoip_country">
52 <syntax><value>database</value></syntax>
53 <default/>
54 <context>http</context>
55
56 <para>
57 指定数据库,用于根据客户端IP地址得到其所在国家。
58 使用这个数据库时,配置中可用下列变量:
59 <list type="tag">
60
61 <tag-name><var>$geoip_country_code</var></tag-name>
62 <tag-desc>
63 双字符国家代码,比如
64 “<literal>RU</literal>”,“<literal>US</literal>”。
65 </tag-desc>
66
67 <tag-name><var>$geoip_country_code3</var></tag-name>
68 <tag-desc>
69 三字符国家代码,比如
70 “<literal>RUS</literal>”,“<literal>USA</literal>”。
71 </tag-desc>
72
73 <tag-name><var>$geoip_country_name</var></tag-name>
74 <tag-desc>
75 国家名称,比如
76 “<literal>Russian Federation</literal>”,“<literal>United States</literal>”。
77 </tag-desc>
78
79 </list>
80 </para>
81
82 </directive>
83
84
85 <directive name="geoip_city">
86 <syntax><value>database</value></syntax>
87 <default/>
88 <context>http</context>
89
90 <para>
91 指定数据库,用于根据客户端IP地址得到其所在的国家、行政区和城市。
92 使用这个数据库时,配置中可用下列变量:
93 <list type="tag">
94
95 <tag-name><var>$geoip_city_country_code</var></tag-name>
96 <tag-desc>
97 双字符国家代码,比如
98 “<literal>RU</literal>”,“<literal>US</literal>”。
99 </tag-desc>
100
101 <tag-name><var>$geoip_city_country_code3</var></tag-name>
102 <tag-desc>
103 三字符国家代码,比如
104 “<literal>RUS</literal>”,“<literal>USA</literal>”。
105 </tag-desc>
106
107 <tag-name><var>$geoip_city_country_name</var></tag-name>
108 <tag-desc>
109 国家名称,比如
110 “<literal>Russian Federation</literal>”,“<literal>United States</literal>”。
111 </tag-desc>
112
113 <tag-name><var>$geoip_region</var></tag-name>
114 <tag-desc>
115 国家行政区名(行政区、直辖区、州、省、联邦管辖区,诸如此类),比如
116 “<literal>Moscow City</literal>”,“<literal>DC</literal>”。
117 </tag-desc>
118
119 <tag-name><var>$geoip_city</var></tag-name>
120 <tag-desc>
121 城市名称,比如
122 “<literal>Moscow</literal>”,“<literal>Washington</literal>”。
123 </tag-desc>
124
125 <tag-name><var>$geoip_postal_code</var></tag-name>
126 <tag-desc>
127 邮编。
128 </tag-desc>
129
130 </list>
131 </para>
132
133 </directive>
134
135
136 <directive name="geoip_proxy">
137 <syntax><value>address</value> | <value>CIDR</value></syntax>
138 <default/>
139 <context>http</context>
140 <appeared-in>1.3.0</appeared-in>
141 <appeared-in>1.2.1</appeared-in>
142
143 <para>
144 定义可信地址。
145 如果请求来自可信地址,nginx将使用其<header>X-Forwarded-For</header>头来获得地址。
146 </para>
147
148 </directive>
149
150
151 <directive name="geoip_proxy_recursive">
152 <syntax><literal>on</literal> | <literal>off</literal></syntax>
153 <default>off</default>
154 <context>http</context>
155 <appeared-in>1.3.0</appeared-in>
156 <appeared-in>1.2.1</appeared-in>
157
158 <para>
159 如果关闭递归查找,在客户端地址与某个可信地址匹配时,nginx将使用<header>X-Forwarded-For</header>中的最后一个地址来代替原始客户端地址。
160 如果开启递归查找,在客户端地址与某个可信地址匹配时,nginx将使用<header>X-Forwarded-For</header>中最后一个与所有可信地址都不匹配的地址来代替原始客户端地址。
161 </para>
162
163 </directive>
164
165 </section>
166
167 </module>