Mercurial > hg > nginx-site
annotate xml/ru/docs/http/ngx_http_referer_module.xml @ 535:f8652d663b62
Revised description of "proxy_pass".
author | Ruslan Ermilov <ru@nginx.com> |
---|---|
date | Thu, 14 Jun 2012 13:08:13 +0000 |
parents | 3878cc99d454 |
children | be54c443235a |
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 |
4a4caa566120
Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
3 <!DOCTYPE module SYSTEM "../../../../dtd/module.dtd"> |
4a4caa566120
Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
4 |
356 | 5 <module name="Модуль ngx_http_referer_module" |
76
4a4caa566120
Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
6 link="/ru/docs/http/ngx_http_referer_module.html" |
4a4caa566120
Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
7 lang="ru"> |
4a4caa566120
Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
8 |
110
40eec261c2a6
Added proper support for anonymous sections, notably for the summary.
Ruslan Ermilov <ru@nginx.com>
parents:
102
diff
changeset
|
9 <section id="summary"> |
76
4a4caa566120
Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
10 |
4a4caa566120
Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
11 <para> |
356 | 12 Модуль <literal>ngx_http_referer_module</literal> позволяет блокировать доступ |
13 к сайту для запросов с неверными значениями поля <header>Referer</header> в | |
14 заголовке. | |
15 Следует иметь в виду, что подделать запрос с нужным значением поля | |
16 <header>Referer</header> не составляет большого труда, поэтому цель | |
17 использования данного модуля заключается не в стопроцентном блокировании | |
18 подобных запросов, а в блокировании массового потока запросов, сделанных | |
19 обычными браузерами. | |
20 Нужно также учитывать, что обычные браузеры могут не передавать поле | |
21 <header>Referer</header> даже для верных запросов. | |
76
4a4caa566120
Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
22 </para> |
4a4caa566120
Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
23 |
4a4caa566120
Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
24 </section> |
4a4caa566120
Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
25 |
4a4caa566120
Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
26 |
356 | 27 <section id="example" name="Пример конфигурации"> |
76
4a4caa566120
Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
28 |
4a4caa566120
Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
29 <para> |
4a4caa566120
Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
30 <example> |
356 | 31 valid_referers none blocked server_names |
490
9913f1d51c07
Replaced "nginx" domain names with example domains.
Ruslan Ermilov <ru@nginx.com>
parents:
364
diff
changeset
|
32 *.example.com example.* www.example.org/galleries/ |
356 | 33 ~\.google\.; |
76
4a4caa566120
Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
34 |
356 | 35 if ($invalid_referer) { |
36 return 403; | |
37 } | |
76
4a4caa566120
Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
38 </example> |
4a4caa566120
Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
39 </para> |
4a4caa566120
Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
40 |
4a4caa566120
Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
41 </section> |
4a4caa566120
Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
42 |
4a4caa566120
Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
43 |
356 | 44 <section id="directives" name="Директивы"> |
76
4a4caa566120
Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
45 |
501
3878cc99d454
Bring ngx_http_referer_module docs up to date, including:
Ruslan Ermilov <ru@nginx.com>
parents:
490
diff
changeset
|
46 <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
|
47 <syntax><value>размер</value></syntax> |
3878cc99d454
Bring ngx_http_referer_module docs up to date, including:
Ruslan Ermilov <ru@nginx.com>
parents:
490
diff
changeset
|
48 <default>64</default> |
3878cc99d454
Bring ngx_http_referer_module docs up to date, including:
Ruslan Ermilov <ru@nginx.com>
parents:
490
diff
changeset
|
49 <context>server</context> |
3878cc99d454
Bring ngx_http_referer_module docs up to date, including:
Ruslan Ermilov <ru@nginx.com>
parents:
490
diff
changeset
|
50 <context>location</context> |
3878cc99d454
Bring ngx_http_referer_module docs up to date, including:
Ruslan Ermilov <ru@nginx.com>
parents:
490
diff
changeset
|
51 <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
|
52 |
3878cc99d454
Bring ngx_http_referer_module docs up to date, including:
Ruslan Ermilov <ru@nginx.com>
parents:
490
diff
changeset
|
53 <para> |
3878cc99d454
Bring ngx_http_referer_module docs up to date, including:
Ruslan Ermilov <ru@nginx.com>
parents:
490
diff
changeset
|
54 Задаёт размер корзины хэш-таблиц со значениями <header>Referer</header>. |
3878cc99d454
Bring ngx_http_referer_module docs up to date, including:
Ruslan Ermilov <ru@nginx.com>
parents:
490
diff
changeset
|
55 Подробнее смотрите в документе по |
3878cc99d454
Bring ngx_http_referer_module docs up to date, including:
Ruslan Ermilov <ru@nginx.com>
parents:
490
diff
changeset
|
56 <link doc="../hash.xml">настройке хэшей</link>. |
3878cc99d454
Bring ngx_http_referer_module docs up to date, including:
Ruslan Ermilov <ru@nginx.com>
parents:
490
diff
changeset
|
57 </para> |
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 </directive> |
3878cc99d454
Bring ngx_http_referer_module docs up to date, including:
Ruslan Ermilov <ru@nginx.com>
parents:
490
diff
changeset
|
60 |
3878cc99d454
Bring ngx_http_referer_module docs up to date, including:
Ruslan Ermilov <ru@nginx.com>
parents:
490
diff
changeset
|
61 |
3878cc99d454
Bring ngx_http_referer_module docs up to date, including:
Ruslan Ermilov <ru@nginx.com>
parents:
490
diff
changeset
|
62 <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
|
63 <syntax><value>размер</value></syntax> |
3878cc99d454
Bring ngx_http_referer_module docs up to date, including:
Ruslan Ermilov <ru@nginx.com>
parents:
490
diff
changeset
|
64 <default>2048</default> |
3878cc99d454
Bring ngx_http_referer_module docs up to date, including:
Ruslan Ermilov <ru@nginx.com>
parents:
490
diff
changeset
|
65 <context>server</context> |
3878cc99d454
Bring ngx_http_referer_module docs up to date, including:
Ruslan Ermilov <ru@nginx.com>
parents:
490
diff
changeset
|
66 <context>location</context> |
3878cc99d454
Bring ngx_http_referer_module docs up to date, including:
Ruslan Ermilov <ru@nginx.com>
parents:
490
diff
changeset
|
67 <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
|
68 |
3878cc99d454
Bring ngx_http_referer_module docs up to date, including:
Ruslan Ermilov <ru@nginx.com>
parents:
490
diff
changeset
|
69 <para> |
3878cc99d454
Bring ngx_http_referer_module docs up to date, including:
Ruslan Ermilov <ru@nginx.com>
parents:
490
diff
changeset
|
70 Задаёт максимальный <value>размер</value> хэш-таблиц со значениями |
3878cc99d454
Bring ngx_http_referer_module docs up to date, including:
Ruslan Ermilov <ru@nginx.com>
parents:
490
diff
changeset
|
71 <header>Referer</header>. |
3878cc99d454
Bring ngx_http_referer_module docs up to date, including:
Ruslan Ermilov <ru@nginx.com>
parents:
490
diff
changeset
|
72 Подробнее смотрите в документе по |
3878cc99d454
Bring ngx_http_referer_module docs up to date, including:
Ruslan Ermilov <ru@nginx.com>
parents:
490
diff
changeset
|
73 <link doc="../hash.xml">настройке хэшей</link>. |
3878cc99d454
Bring ngx_http_referer_module docs up to date, including:
Ruslan Ermilov <ru@nginx.com>
parents:
490
diff
changeset
|
74 </para> |
3878cc99d454
Bring ngx_http_referer_module docs up to date, including:
Ruslan Ermilov <ru@nginx.com>
parents:
490
diff
changeset
|
75 |
3878cc99d454
Bring ngx_http_referer_module docs up to date, including:
Ruslan Ermilov <ru@nginx.com>
parents:
490
diff
changeset
|
76 </directive> |
3878cc99d454
Bring ngx_http_referer_module docs up to date, including:
Ruslan Ermilov <ru@nginx.com>
parents:
490
diff
changeset
|
77 |
3878cc99d454
Bring ngx_http_referer_module docs up to date, including:
Ruslan Ermilov <ru@nginx.com>
parents:
490
diff
changeset
|
78 |
76
4a4caa566120
Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
79 <directive name="valid_referers"> |
271 | 80 <syntax> |
364 | 81 <literal>none</literal> | |
82 <literal>blocked</literal> | | |
83 <literal>server_names</literal> | | |
84 <value>строка</value> | |
85 ...</syntax> | |
99
1d315ef37215
The case <default/> is now language-agnostic.
Ruslan Ermilov <ru@nginx.com>
parents:
76
diff
changeset
|
86 <default/> |
356 | 87 <context>server</context> |
88 <context>location</context> | |
76
4a4caa566120
Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
89 |
4a4caa566120
Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
90 <para> |
356 | 91 Задаёт значения поля <header>Referer</header> заголовка запроса, при |
92 которых встроенная переменная <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
|
93 пустую строку в качестве значения. |
3878cc99d454
Bring ngx_http_referer_module docs up to date, including:
Ruslan Ermilov <ru@nginx.com>
parents:
490
diff
changeset
|
94 В противном случае значение переменной равно “<literal>1</literal>”. |
3878cc99d454
Bring ngx_http_referer_module docs up to date, including:
Ruslan Ermilov <ru@nginx.com>
parents:
490
diff
changeset
|
95 Поиск совпадения производится без учёта регистра символов. |
76
4a4caa566120
Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
96 </para> |
4a4caa566120
Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
97 |
4a4caa566120
Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
98 <para> |
4a4caa566120
Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
99 Параметры могут быть следующие: |
356 | 100 <list type="tag"> |
76
4a4caa566120
Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
101 |
356 | 102 <tag-name><literal>none</literal></tag-name> |
103 <tag-desc> | |
104 поле <header>Referer</header> в заголовке запроса отсутствует; | |
105 </tag-desc> | |
76
4a4caa566120
Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
106 |
356 | 107 <tag-name><literal>blocked</literal></tag-name> |
108 <tag-desc> | |
109 поле <header>Referer</header> в заголовке запроса присутствует, | |
110 но его значение удалено межсетевым экраном (firewall) или прокси-сервером; | |
111 к таким значениям относятся строки, не начинающиеся на | |
501
3878cc99d454
Bring ngx_http_referer_module docs up to date, including:
Ruslan Ermilov <ru@nginx.com>
parents:
490
diff
changeset
|
112 “<literal>http://</literal>” или “<literal>https://</literal>”; |
356 | 113 </tag-desc> |
76
4a4caa566120
Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
114 |
356 | 115 <tag-name><literal>server_names</literal></tag-name> |
116 <tag-desc> | |
117 в поле <header>Referer</header> заголовка запроса указано одно | |
76
4a4caa566120
Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
118 из имён сервера; |
356 | 119 </tag-desc> |
76
4a4caa566120
Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
120 |
356 | 121 <tag-name>произвольная строка</tag-name> |
122 <tag-desc> | |
123 задаёт имя сервера и необязательное начало URI. | |
124 В начале или конце имени сервера может быть “<literal>*</literal>”. | |
125 При проверке порт сервера в поле <header>Referer</header> игнорируется; | |
126 </tag-desc> | |
76
4a4caa566120
Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
127 |
356 | 128 <tag-name>регулярное выражение</tag-name> |
129 <tag-desc> | |
130 в начале должен быть символ “<literal>~</literal>”. | |
76
4a4caa566120
Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
131 Необходимо учитывать, что на совпадение с выражением будет проверяться |
501
3878cc99d454
Bring ngx_http_referer_module docs up to date, including:
Ruslan Ermilov <ru@nginx.com>
parents:
490
diff
changeset
|
132 текст, начинающийся после “<literal>http://</literal>” |
3878cc99d454
Bring ngx_http_referer_module docs up to date, including:
Ruslan Ermilov <ru@nginx.com>
parents:
490
diff
changeset
|
133 или “<literal>https://</literal>”. |
356 | 134 </tag-desc> |
76
4a4caa566120
Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
135 |
4a4caa566120
Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
136 </list> |
4a4caa566120
Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
137 </para> |
4a4caa566120
Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
138 |
4a4caa566120
Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
139 <para> |
356 | 140 Пример: |
76
4a4caa566120
Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
141 <example> |
356 | 142 valid_referers none blocked server_names |
490
9913f1d51c07
Replaced "nginx" domain names with example domains.
Ruslan Ermilov <ru@nginx.com>
parents:
364
diff
changeset
|
143 *.example.com example.* www.example.org/galleries/ |
356 | 144 ~\.google\.; |
76
4a4caa566120
Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
145 </example> |
4a4caa566120
Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
146 </para> |
4a4caa566120
Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
147 |
4a4caa566120
Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
148 </directive> |
4a4caa566120
Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
149 |
4a4caa566120
Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
150 </section> |
4a4caa566120
Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
151 |
4a4caa566120
Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
152 </module> |