Mercurial > hg > nginx-site
comparison xml/en/docs/http/ngx_http_browser_module.xml @ 315:e00f8f8c0486
Translated ngx_http_access_module, ngx_http_addition_module,
ngx_http_auth_basic_module, ngx_http_autoindex_module, and
ngx_http_browser_module into English.
author | Ruslan Ermilov <ru@nginx.com> |
---|---|
date | Fri, 13 Jan 2012 18:05:01 +0000 |
parents | |
children | a4fa80755eab |
comparison
equal
deleted
inserted
replaced
314:95d5dc7c9884 | 315:e00f8f8c0486 |
---|---|
1 <?xml version="1.0"?> | |
2 | |
3 <!DOCTYPE module SYSTEM "../../../../dtd/module.dtd"> | |
4 | |
5 <module name="Module ngx_http_browser_module" | |
6 link="/en/docs/http/ngx_http_browser_module.html" | |
7 lang="en"> | |
8 | |
9 <section id="summary"> | |
10 | |
11 <para> | |
12 The <literal>ngx_http_browser_module</literal> module creates variables | |
13 whose values depend on the value of the <header>User-Agent</header> | |
14 request header field: | |
15 <list type="tag"> | |
16 | |
17 <tag-name><var>$modern_browser</var></tag-name> | |
18 <tag-desc> | |
19 equals to the value set by the <link id="modern_browser_value"/> directive, | |
20 if a browser was identified as modern; | |
21 </tag-desc> | |
22 | |
23 <tag-name><var>$ancient_browser</var></tag-name> | |
24 <tag-desc> | |
25 equals to the value set by the <link id="ancient_browser_value"/> directive, | |
26 if a browser was identified as ancient; | |
27 </tag-desc> | |
28 | |
29 <tag-name><var>$msie</var></tag-name> | |
30 <tag-desc> | |
31 equals “1” if a browser was identified as MSIE of any version. | |
32 </tag-desc> | |
33 | |
34 </list> | |
35 </para> | |
36 | |
37 </section> | |
38 | |
39 | |
40 <section id="example" name="Example Configuration"> | |
41 | |
42 <para> | |
43 Choosing an index file: | |
44 <example> | |
45 modern_browser_value "modern."; | |
46 | |
47 modern_browser msie 5.5; | |
48 modern_browser gecko 1.0.0; | |
49 modern_browser opera 9.0; | |
50 modern_browser safari 413; | |
51 modern_browser konqueror 3.0; | |
52 | |
53 index index.${modern_browser}html index.html; | |
54 </example> | |
55 </para> | |
56 | |
57 <para> | |
58 Redirection for old browsers: | |
59 <example> | |
60 modern_browser msie 5.0; | |
61 modern_browser gecko 0.9.1; | |
62 modern_browser opera 8.0; | |
63 modern_browser safari 413; | |
64 modern_browser konqueror 3.0; | |
65 | |
66 modern_browser unlisted; | |
67 | |
68 ancient_browser Links Lynx netscape4; | |
69 | |
70 if ($ancient_browser) { | |
71 rewrite ^ /ancient.html; | |
72 } | |
73 </example> | |
74 </para> | |
75 | |
76 </section> | |
77 | |
78 | |
79 <section id="directives" name="Directives"> | |
80 | |
81 <directive name="ancient_browser"> | |
82 <syntax><value>string</value> ...</syntax> | |
83 <default/> | |
84 <context>http</context> | |
85 <context>server</context> | |
86 <context>location</context> | |
87 | |
88 <para> | |
89 If any of the specified substrings is found in the <header>User-Agent</header> | |
90 request header field, a browser will be considered ancient. | |
91 The special string “<literal>netscape4</literal>” corresponds to the | |
92 regular expression “<literal>^Mozilla/[1-4]</literal>”. | |
93 </para> | |
94 | |
95 </directive> | |
96 | |
97 | |
98 <directive name="ancient_browser_value"> | |
99 <syntax><value>string</value></syntax> | |
100 <default>1</default> | |
101 <context>http</context> | |
102 <context>server</context> | |
103 <context>location</context> | |
104 | |
105 <para> | |
106 Sets a value for the <var>$ancient_browser</var> variables. | |
107 </para> | |
108 | |
109 </directive> | |
110 | |
111 | |
112 <directive name="modern_browser"> | |
113 <syntax><value>browser</value> <value>version</value></syntax> | |
114 <syntax><literal>unlisted</literal></syntax> | |
115 <default/> | |
116 <context>http</context> | |
117 <context>server</context> | |
118 <context>location</context> | |
119 | |
120 <para> | |
121 Specifies a version starting from which a browser is considered modern. | |
122 A browser can be any one of the following: <literal>msie</literal>, | |
123 <literal>gecko</literal> (browsers based on Mozilla), | |
124 <literal>opera</literal>, <literal>safari</literal>, | |
125 or <literal>konqueror</literal>. | |
126 </para> | |
127 | |
128 <para> | |
129 Versions can be specified in the following formats: X, X.X, X.X.X, or X.X.X.X. | |
130 The maximum values for each of the format are | |
131 4000, 4000.99, 4000.99.99, and 4000.99.99.99, respectively. | |
132 </para> | |
133 | |
134 <para> | |
135 The special value <literal>unlisted</literal> specifies to consider | |
136 a browser as modern if it was not listed by the | |
137 <literal>modern_browser</literal> and <link id="ancient_browser"/> | |
138 directives. | |
139 Otherwise such a browser is considered ancient. | |
140 If a request does not provide the <header>User-Agent</header> field | |
141 in the header, a browser is treated as not being listed. | |
142 </para> | |
143 | |
144 </directive> | |
145 | |
146 | |
147 <directive name="modern_browser_value"> | |
148 <syntax><value>string</value></syntax> | |
149 <default>1</default> | |
150 <context>http</context> | |
151 <context>server</context> | |
152 <context>location</context> | |
153 | |
154 <para> | |
155 Sets a value for the <var>$modern_browser</var> variables. | |
156 </para> | |
157 | |
158 </directive> | |
159 | |
160 </section> | |
161 | |
162 </module> |