Mercurial > hg > nginx-site
comparison xml/en/docs/http/ngx_http_referer_module.xml @ 357:3d6c27e22625
Translated ngx_http_referer_module into English.
author | Ruslan Ermilov <ru@nginx.com> |
---|---|
date | Wed, 25 Jan 2012 16:35:53 +0000 |
parents | |
children | bb51d3e17dd0 |
comparison
equal
deleted
inserted
replaced
356:ccb8e9a12e2f | 357:3d6c27e22625 |
---|---|
1 <?xml version="1.0"?> | |
2 | |
3 <!DOCTYPE module SYSTEM "../../../../dtd/module.dtd"> | |
4 | |
5 <module name="Module ngx_http_referer_module" | |
6 link="/en/docs/http/ngx_http_referer_module.html" | |
7 lang="en"> | |
8 | |
9 <section id="summary"> | |
10 | |
11 <para> | |
12 The <literal>ngx_http_referer_module</literal> module allows to block | |
13 access to a site for requests with invalid values in the | |
14 <header>Referer</header> header field. | |
15 It should be kept in mind that fabricating a request with an appropriate | |
16 <header>Referer</header> field value is quite easy, and so the intended | |
17 purpose of this module is not to block such requests thoroughly but to block | |
18 the mass flow of requests sent by regular browsers. | |
19 It should also be taken into consideration that regular browsers may | |
20 not send the <header>Referer</header> field even for valid requests. | |
21 </para> | |
22 | |
23 </section> | |
24 | |
25 | |
26 <section id="example" name="Example Configuration"> | |
27 | |
28 <para> | |
29 <example> | |
30 valid_referers none blocked server_names | |
31 *.example.com example.* www.example.info/galleries/ | |
32 ~\.google\.; | |
33 | |
34 if ($invalid_referer) { | |
35 return 403; | |
36 } | |
37 </example> | |
38 </para> | |
39 | |
40 </section> | |
41 | |
42 | |
43 <section id="directives" name="Directives"> | |
44 | |
45 <directive name="valid_referers"> | |
46 <syntax> | |
47 <literal>none</literal> | | |
48 <literal>blocked</literal> | | |
49 <literal>server_names</literal> | | |
50 <value>string</value> | |
51 ...</syntax> | |
52 <default/> | |
53 <context>server</context> | |
54 <context>location</context> | |
55 | |
56 <para> | |
57 Specifies values of the <header>Referer</header> request header field | |
58 that will cause the embedded variable <var>$invalid_referer</var> to | |
59 be set to 0. | |
60 </para> | |
61 | |
62 <para> | |
63 Parameters can be as follows: | |
64 <list type="tag"> | |
65 | |
66 <tag-name><literal>none</literal></tag-name> | |
67 <tag-desc> | |
68 the <header>Referer</header> field is missing in the request header; | |
69 </tag-desc> | |
70 | |
71 <tag-name><literal>blocked</literal></tag-name> | |
72 <tag-desc> | |
73 the <header>Referer</header> field is present in the request header, | |
74 but its value was deleted by a firewall or proxy server; | |
75 such values are strings that do not start from | |
76 “<literal>http://</literal>”; | |
77 </tag-desc> | |
78 | |
79 <tag-name><literal>server_names</literal></tag-name> | |
80 <tag-desc> | |
81 the <header>Referer</header> request header field contains | |
82 one of the server names; | |
83 </tag-desc> | |
84 | |
85 <tag-name>arbitrary string</tag-name> | |
86 <tag-desc> | |
87 defines a server name and an optional URI prefix. | |
88 A server name can have an “<literal>*</literal>” at the beginning or end. | |
89 When checking, the server’s port in the <header>Referer</header> field | |
90 is ignored; | |
91 </tag-desc> | |
92 | |
93 <tag-name>regular expression</tag-name> | |
94 <tag-desc> | |
95 the first symbol should be a “<literal>~</literal>”. | |
96 It should be noted that an expression will be matched against | |
97 the text starting after the “<literal>http://</literal>”. | |
98 </tag-desc> | |
99 | |
100 </list> | |
101 </para> | |
102 | |
103 <para> | |
104 Example: | |
105 <example> | |
106 valid_referers none blocked server_names | |
107 *.example.com example.* www.example.info/galleries/ | |
108 ~\.google\.; | |
109 </example> | |
110 </para> | |
111 | |
112 </directive> | |
113 | |
114 </section> | |
115 | |
116 </module> |