Mercurial > hg > nginx-site
annotate xml/ru/docs/http/ngx_http_referer_module.xml @ 1578:31f21c7956dd
Changed "Bugs" to "Issues" for perl and spdy.
author | Yaroslav Zhuravlev <yar@nginx.com> |
---|---|
date | Mon, 28 Sep 2015 23:04:43 +0300 |
parents | a8a643647c76 |
children |
rev | line source |
---|---|
222
bfe3eff81d04
Removed redundant encoding specification.
Ruslan Ermilov <ru@nginx.com>
parents:
110
diff
changeset
|
1 <?xml version="1.0"?> |
76
4a4caa566120
Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
2 |
580
be54c443235a
Added copyright markers to documentation sources.
Ruslan Ermilov <ru@nginx.com>
parents:
501
diff
changeset
|
3 <!-- |
be54c443235a
Added copyright markers to documentation sources.
Ruslan Ermilov <ru@nginx.com>
parents:
501
diff
changeset
|
4 Copyright (C) Igor Sysoev |
be54c443235a
Added copyright markers to documentation sources.
Ruslan Ermilov <ru@nginx.com>
parents:
501
diff
changeset
|
5 Copyright (C) Nginx, Inc. |
be54c443235a
Added copyright markers to documentation sources.
Ruslan Ermilov <ru@nginx.com>
parents:
501
diff
changeset
|
6 --> |
be54c443235a
Added copyright markers to documentation sources.
Ruslan Ermilov <ru@nginx.com>
parents:
501
diff
changeset
|
7 |
76
4a4caa566120
Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
8 <!DOCTYPE module SYSTEM "../../../../dtd/module.dtd"> |
4a4caa566120
Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
9 |
356 | 10 <module name="Модуль ngx_http_referer_module" |
76
4a4caa566120
Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
11 link="/ru/docs/http/ngx_http_referer_module.html" |
589 | 12 lang="ru" |
1157
a8a643647c76
Added descriptions for $invalid_referer and $memcached_key.
Vladimir Homutov <vl@nginx.com>
parents:
659
diff
changeset
|
13 rev="2"> |
76
4a4caa566120
Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
14 |
110
40eec261c2a6
Added proper support for anonymous sections, notably for the summary.
Ruslan Ermilov <ru@nginx.com>
parents:
102
diff
changeset
|
15 <section id="summary"> |
76
4a4caa566120
Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
16 |
4a4caa566120
Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
17 <para> |
356 | 18 Модуль <literal>ngx_http_referer_module</literal> позволяет блокировать доступ |
19 к сайту для запросов с неверными значениями поля <header>Referer</header> в | |
20 заголовке. | |
21 Следует иметь в виду, что подделать запрос с нужным значением поля | |
22 <header>Referer</header> не составляет большого труда, поэтому цель | |
23 использования данного модуля заключается не в стопроцентном блокировании | |
24 подобных запросов, а в блокировании массового потока запросов, сделанных | |
25 обычными браузерами. | |
26 Нужно также учитывать, что обычные браузеры могут не передавать поле | |
27 <header>Referer</header> даже для верных запросов. | |
76
4a4caa566120
Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
28 </para> |
4a4caa566120
Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
29 |
4a4caa566120
Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
30 </section> |
4a4caa566120
Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
31 |
4a4caa566120
Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
32 |
356 | 33 <section id="example" name="Пример конфигурации"> |
76
4a4caa566120
Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
34 |
4a4caa566120
Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
35 <para> |
4a4caa566120
Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
36 <example> |
356 | 37 valid_referers none blocked server_names |
490
9913f1d51c07
Replaced "nginx" domain names with example domains.
Ruslan Ermilov <ru@nginx.com>
parents:
364
diff
changeset
|
38 *.example.com example.* www.example.org/galleries/ |
356 | 39 ~\.google\.; |
76
4a4caa566120
Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
40 |
356 | 41 if ($invalid_referer) { |
42 return 403; | |
43 } | |
76
4a4caa566120
Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
44 </example> |
4a4caa566120
Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
45 </para> |
4a4caa566120
Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
46 |
4a4caa566120
Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
47 </section> |
4a4caa566120
Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
48 |
4a4caa566120
Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
49 |
356 | 50 <section id="directives" name="Директивы"> |
76
4a4caa566120
Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
51 |
501
3878cc99d454
Bring ngx_http_referer_module docs up to date, including:
Ruslan Ermilov <ru@nginx.com>
parents:
490
diff
changeset
|
52 <directive name="referer_hash_bucket_size"> |
3878cc99d454
Bring ngx_http_referer_module docs up to date, including:
Ruslan Ermilov <ru@nginx.com>
parents:
490
diff
changeset
|
53 <syntax><value>размер</value></syntax> |
3878cc99d454
Bring ngx_http_referer_module docs up to date, including:
Ruslan Ermilov <ru@nginx.com>
parents:
490
diff
changeset
|
54 <default>64</default> |
3878cc99d454
Bring ngx_http_referer_module docs up to date, including:
Ruslan Ermilov <ru@nginx.com>
parents:
490
diff
changeset
|
55 <context>server</context> |
3878cc99d454
Bring ngx_http_referer_module docs up to date, including:
Ruslan Ermilov <ru@nginx.com>
parents:
490
diff
changeset
|
56 <context>location</context> |
3878cc99d454
Bring ngx_http_referer_module docs up to date, including:
Ruslan Ermilov <ru@nginx.com>
parents:
490
diff
changeset
|
57 <appeared-in>1.0.5</appeared-in> |
3878cc99d454
Bring ngx_http_referer_module docs up to date, including:
Ruslan Ermilov <ru@nginx.com>
parents:
490
diff
changeset
|
58 |
3878cc99d454
Bring ngx_http_referer_module docs up to date, including:
Ruslan Ermilov <ru@nginx.com>
parents:
490
diff
changeset
|
59 <para> |
3878cc99d454
Bring ngx_http_referer_module docs up to date, including:
Ruslan Ermilov <ru@nginx.com>
parents:
490
diff
changeset
|
60 Задаёт размер корзины хэш-таблиц со значениями <header>Referer</header>. |
659
77a3314c74a7
Avoid the uses of second person.
Ruslan Ermilov <ru@nginx.com>
parents:
589
diff
changeset
|
61 Подробнее настройка хэш-таблиц обсуждается в отдельном |
77a3314c74a7
Avoid the uses of second person.
Ruslan Ermilov <ru@nginx.com>
parents:
589
diff
changeset
|
62 <link doc="../hash.xml">документе</link>. |
501
3878cc99d454
Bring ngx_http_referer_module docs up to date, including:
Ruslan Ermilov <ru@nginx.com>
parents:
490
diff
changeset
|
63 </para> |
3878cc99d454
Bring ngx_http_referer_module docs up to date, including:
Ruslan Ermilov <ru@nginx.com>
parents:
490
diff
changeset
|
64 |
3878cc99d454
Bring ngx_http_referer_module docs up to date, including:
Ruslan Ermilov <ru@nginx.com>
parents:
490
diff
changeset
|
65 </directive> |
3878cc99d454
Bring ngx_http_referer_module docs up to date, including:
Ruslan Ermilov <ru@nginx.com>
parents:
490
diff
changeset
|
66 |
3878cc99d454
Bring ngx_http_referer_module docs up to date, including:
Ruslan Ermilov <ru@nginx.com>
parents:
490
diff
changeset
|
67 |
3878cc99d454
Bring ngx_http_referer_module docs up to date, including:
Ruslan Ermilov <ru@nginx.com>
parents:
490
diff
changeset
|
68 <directive name="referer_hash_max_size"> |
3878cc99d454
Bring ngx_http_referer_module docs up to date, including:
Ruslan Ermilov <ru@nginx.com>
parents:
490
diff
changeset
|
69 <syntax><value>размер</value></syntax> |
3878cc99d454
Bring ngx_http_referer_module docs up to date, including:
Ruslan Ermilov <ru@nginx.com>
parents:
490
diff
changeset
|
70 <default>2048</default> |
3878cc99d454
Bring ngx_http_referer_module docs up to date, including:
Ruslan Ermilov <ru@nginx.com>
parents:
490
diff
changeset
|
71 <context>server</context> |
3878cc99d454
Bring ngx_http_referer_module docs up to date, including:
Ruslan Ermilov <ru@nginx.com>
parents:
490
diff
changeset
|
72 <context>location</context> |
3878cc99d454
Bring ngx_http_referer_module docs up to date, including:
Ruslan Ermilov <ru@nginx.com>
parents:
490
diff
changeset
|
73 <appeared-in>1.0.5</appeared-in> |
3878cc99d454
Bring ngx_http_referer_module docs up to date, including:
Ruslan Ermilov <ru@nginx.com>
parents:
490
diff
changeset
|
74 |
3878cc99d454
Bring ngx_http_referer_module docs up to date, including:
Ruslan Ermilov <ru@nginx.com>
parents:
490
diff
changeset
|
75 <para> |
3878cc99d454
Bring ngx_http_referer_module docs up to date, including:
Ruslan Ermilov <ru@nginx.com>
parents:
490
diff
changeset
|
76 Задаёт максимальный <value>размер</value> хэш-таблиц со значениями |
3878cc99d454
Bring ngx_http_referer_module docs up to date, including:
Ruslan Ermilov <ru@nginx.com>
parents:
490
diff
changeset
|
77 <header>Referer</header>. |
659
77a3314c74a7
Avoid the uses of second person.
Ruslan Ermilov <ru@nginx.com>
parents:
589
diff
changeset
|
78 Подробнее настройка хэш-таблиц обсуждается в отдельном |
77a3314c74a7
Avoid the uses of second person.
Ruslan Ermilov <ru@nginx.com>
parents:
589
diff
changeset
|
79 <link doc="../hash.xml">документе</link>. |
501
3878cc99d454
Bring ngx_http_referer_module docs up to date, including:
Ruslan Ermilov <ru@nginx.com>
parents:
490
diff
changeset
|
80 </para> |
3878cc99d454
Bring ngx_http_referer_module docs up to date, including:
Ruslan Ermilov <ru@nginx.com>
parents:
490
diff
changeset
|
81 |
3878cc99d454
Bring ngx_http_referer_module docs up to date, including:
Ruslan Ermilov <ru@nginx.com>
parents:
490
diff
changeset
|
82 </directive> |
3878cc99d454
Bring ngx_http_referer_module docs up to date, including:
Ruslan Ermilov <ru@nginx.com>
parents:
490
diff
changeset
|
83 |
3878cc99d454
Bring ngx_http_referer_module docs up to date, including:
Ruslan Ermilov <ru@nginx.com>
parents:
490
diff
changeset
|
84 |
76
4a4caa566120
Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
85 <directive name="valid_referers"> |
271 | 86 <syntax> |
364 | 87 <literal>none</literal> | |
88 <literal>blocked</literal> | | |
89 <literal>server_names</literal> | | |
90 <value>строка</value> | |
91 ...</syntax> | |
99
1d315ef37215
The case <default/> is now language-agnostic.
Ruslan Ermilov <ru@nginx.com>
parents:
76
diff
changeset
|
92 <default/> |
356 | 93 <context>server</context> |
94 <context>location</context> | |
76
4a4caa566120
Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
95 |
4a4caa566120
Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
96 <para> |
356 | 97 Задаёт значения поля <header>Referer</header> заголовка запроса, при |
98 которых встроенная переменная <var>$invalid_referer</var> будет иметь | |
501
3878cc99d454
Bring ngx_http_referer_module docs up to date, including:
Ruslan Ermilov <ru@nginx.com>
parents:
490
diff
changeset
|
99 пустую строку в качестве значения. |
3878cc99d454
Bring ngx_http_referer_module docs up to date, including:
Ruslan Ermilov <ru@nginx.com>
parents:
490
diff
changeset
|
100 В противном случае значение переменной равно “<literal>1</literal>”. |
3878cc99d454
Bring ngx_http_referer_module docs up to date, including:
Ruslan Ermilov <ru@nginx.com>
parents:
490
diff
changeset
|
101 Поиск совпадения производится без учёта регистра символов. |
76
4a4caa566120
Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
102 </para> |
4a4caa566120
Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
103 |
4a4caa566120
Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
104 <para> |
4a4caa566120
Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
105 Параметры могут быть следующие: |
356 | 106 <list type="tag"> |
76
4a4caa566120
Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
107 |
356 | 108 <tag-name><literal>none</literal></tag-name> |
109 <tag-desc> | |
110 поле <header>Referer</header> в заголовке запроса отсутствует; | |
111 </tag-desc> | |
76
4a4caa566120
Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
112 |
356 | 113 <tag-name><literal>blocked</literal></tag-name> |
114 <tag-desc> | |
115 поле <header>Referer</header> в заголовке запроса присутствует, | |
116 но его значение удалено межсетевым экраном (firewall) или прокси-сервером; | |
117 к таким значениям относятся строки, не начинающиеся на | |
501
3878cc99d454
Bring ngx_http_referer_module docs up to date, including:
Ruslan Ermilov <ru@nginx.com>
parents:
490
diff
changeset
|
118 “<literal>http://</literal>” или “<literal>https://</literal>”; |
356 | 119 </tag-desc> |
76
4a4caa566120
Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
120 |
356 | 121 <tag-name><literal>server_names</literal></tag-name> |
122 <tag-desc> | |
123 в поле <header>Referer</header> заголовка запроса указано одно | |
76
4a4caa566120
Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
124 из имён сервера; |
356 | 125 </tag-desc> |
76
4a4caa566120
Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
126 |
356 | 127 <tag-name>произвольная строка</tag-name> |
128 <tag-desc> | |
129 задаёт имя сервера и необязательное начало URI. | |
130 В начале или конце имени сервера может быть “<literal>*</literal>”. | |
131 При проверке порт сервера в поле <header>Referer</header> игнорируется; | |
132 </tag-desc> | |
76
4a4caa566120
Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
133 |
356 | 134 <tag-name>регулярное выражение</tag-name> |
135 <tag-desc> | |
136 в начале должен быть символ “<literal>~</literal>”. | |
76
4a4caa566120
Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
137 Необходимо учитывать, что на совпадение с выражением будет проверяться |
501
3878cc99d454
Bring ngx_http_referer_module docs up to date, including:
Ruslan Ermilov <ru@nginx.com>
parents:
490
diff
changeset
|
138 текст, начинающийся после “<literal>http://</literal>” |
3878cc99d454
Bring ngx_http_referer_module docs up to date, including:
Ruslan Ermilov <ru@nginx.com>
parents:
490
diff
changeset
|
139 или “<literal>https://</literal>”. |
356 | 140 </tag-desc> |
76
4a4caa566120
Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
141 |
4a4caa566120
Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
142 </list> |
4a4caa566120
Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
143 </para> |
4a4caa566120
Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
144 |
4a4caa566120
Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
145 <para> |
356 | 146 Пример: |
76
4a4caa566120
Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
147 <example> |
356 | 148 valid_referers none blocked server_names |
490
9913f1d51c07
Replaced "nginx" domain names with example domains.
Ruslan Ermilov <ru@nginx.com>
parents:
364
diff
changeset
|
149 *.example.com example.* www.example.org/galleries/ |
356 | 150 ~\.google\.; |
76
4a4caa566120
Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
151 </example> |
4a4caa566120
Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
152 </para> |
4a4caa566120
Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
153 |
4a4caa566120
Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
154 </directive> |
4a4caa566120
Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
155 |
4a4caa566120
Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
156 </section> |
4a4caa566120
Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
157 |
1157
a8a643647c76
Added descriptions for $invalid_referer and $memcached_key.
Vladimir Homutov <vl@nginx.com>
parents:
659
diff
changeset
|
158 |
a8a643647c76
Added descriptions for $invalid_referer and $memcached_key.
Vladimir Homutov <vl@nginx.com>
parents:
659
diff
changeset
|
159 <section id="variables" name="Встроенные переменные"> |
a8a643647c76
Added descriptions for $invalid_referer and $memcached_key.
Vladimir Homutov <vl@nginx.com>
parents:
659
diff
changeset
|
160 |
a8a643647c76
Added descriptions for $invalid_referer and $memcached_key.
Vladimir Homutov <vl@nginx.com>
parents:
659
diff
changeset
|
161 <para> |
a8a643647c76
Added descriptions for $invalid_referer and $memcached_key.
Vladimir Homutov <vl@nginx.com>
parents:
659
diff
changeset
|
162 <list type="tag"> |
a8a643647c76
Added descriptions for $invalid_referer and $memcached_key.
Vladimir Homutov <vl@nginx.com>
parents:
659
diff
changeset
|
163 |
a8a643647c76
Added descriptions for $invalid_referer and $memcached_key.
Vladimir Homutov <vl@nginx.com>
parents:
659
diff
changeset
|
164 <tag-name id="var_invalid_referer"><var>$invalid_referer</var></tag-name> |
a8a643647c76
Added descriptions for $invalid_referer and $memcached_key.
Vladimir Homutov <vl@nginx.com>
parents:
659
diff
changeset
|
165 <tag-desc> |
a8a643647c76
Added descriptions for $invalid_referer and $memcached_key.
Vladimir Homutov <vl@nginx.com>
parents:
659
diff
changeset
|
166 Пустая строка, если значение поля <header>Referer</header> заголовка запроса |
a8a643647c76
Added descriptions for $invalid_referer and $memcached_key.
Vladimir Homutov <vl@nginx.com>
parents:
659
diff
changeset
|
167 считается |
a8a643647c76
Added descriptions for $invalid_referer and $memcached_key.
Vladimir Homutov <vl@nginx.com>
parents:
659
diff
changeset
|
168 <link id="valid_referers">правильным</link>, иначе “<literal>1</literal>”. |
a8a643647c76
Added descriptions for $invalid_referer and $memcached_key.
Vladimir Homutov <vl@nginx.com>
parents:
659
diff
changeset
|
169 </tag-desc> |
a8a643647c76
Added descriptions for $invalid_referer and $memcached_key.
Vladimir Homutov <vl@nginx.com>
parents:
659
diff
changeset
|
170 |
a8a643647c76
Added descriptions for $invalid_referer and $memcached_key.
Vladimir Homutov <vl@nginx.com>
parents:
659
diff
changeset
|
171 </list> |
a8a643647c76
Added descriptions for $invalid_referer and $memcached_key.
Vladimir Homutov <vl@nginx.com>
parents:
659
diff
changeset
|
172 </para> |
a8a643647c76
Added descriptions for $invalid_referer and $memcached_key.
Vladimir Homutov <vl@nginx.com>
parents:
659
diff
changeset
|
173 |
a8a643647c76
Added descriptions for $invalid_referer and $memcached_key.
Vladimir Homutov <vl@nginx.com>
parents:
659
diff
changeset
|
174 </section> |
a8a643647c76
Added descriptions for $invalid_referer and $memcached_key.
Vladimir Homutov <vl@nginx.com>
parents:
659
diff
changeset
|
175 |
76
4a4caa566120
Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
176 </module> |