annotate xml/ru/docs/http/ngx_http_core_module.xml @ 270:945d7299c26c

Spaces are now preserved here, so removed all the hacks.
author Ruslan Ermilov <ru@nginx.com>
date Thu, 22 Dec 2011 13:39:18 +0000
parents ff1e139a8c98
children 4c6d2c614d2c
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
222
bfe3eff81d04 Removed redundant encoding specification.
Ruslan Ermilov <ru@nginx.com>
parents: 108
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
253
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
5 <module name="Модуль ngx_http_core_module"
76
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
6 link="/ru/docs/http/ngx_http_core_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
253
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
9 <section id="directives" name="Директивы">
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 <directive name="aio">
253
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
12 <syntax>
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
13 <value>on</value> |
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
14 <value>off</value> |
270
945d7299c26c Spaces are now preserved here, so removed all the hacks.
Ruslan Ermilov <ru@nginx.com>
parents: 253
diff changeset
15 <value>sendfile</value></syntax>
102
c76a257f3fd4 The directive name is now automatically printed in <default> and <syntax>.
Ruslan Ermilov <ru@nginx.com>
parents: 99
diff changeset
16 <default>off</default>
253
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
17 <context>http</context>
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
18 <context>server</context>
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
19 <context>location</context>
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
20 <appeared-in>0.8.11</appeared-in>
76
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
21
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
22 <para>
253
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
23 Разрешает или запрещает использование файлового асинхронного ввода-вывода (AIO)
76
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
24 во FreeBSD и Linux.
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
25 </para>
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
26
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
27 <para>
253
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
28 Во FreeBSD AIO можно использовать, начиная с FreeBSD&nbsp;4.3.
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
29 AIO можно либо собрать в ядре статически:
76
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
30 <example>
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
31 options VFS_AIO
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
32 </example>
253
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
33 либо загрузить динамически через загружаемый модуль ядра:
76
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
34 <example>
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
35 kldload aio
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
36 </example>
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
37 </para>
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
38
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
39 <para>
253
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
40 В версиях FreeBSD 5 и 6 включение AIO статически или динамически
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
41 на стадии загрузки ядра приводит к тому, что вся сетевая подсистема
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
42 будет использовать блокировку Giant, что может негативно сказаться на
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
43 производительности системы в целом.
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
44 Это ограничение устранено во FreeBSD&nbsp;6.4-STABLE в 2009 году
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
45 и во FreeBSD&nbsp;7.
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
46 Однако, начиная с FreeBSD&nbsp;5.3 есть возможность включать AIO,
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
47 не связывая сетевую подсистему блокировкой Giant — для этого модуль
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
48 AIO нужно подгружать уже после загрузки ядра.
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
49 В этом случае в <path>/var/log/messages</path> появится следующее сообщение:
76
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
50 <example>
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
51 WARNING: Network stack Giant-free, but aio requires Giant.
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
52 Consider adding 'options NET_WITH_GIANT' or setting debug.mpsafenet=0
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
53 </example>
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
54 которое можно смело проигнорировать.
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
55 <note>
253
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
56 Требование использовать блокировку Giant в AIO связано с тем, что
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
57 FreeBSD поддерживает асинхронные вызовы
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
58 <c-func>aio_read</c-func>
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
59 и
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
60 <c-func>aio_write</c-func>
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
61 для работы с сокетами.
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
62 Но поскольку nginx использует AIO только для работы с диском,
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
63 то проблем не возникает.
76
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
64 </note>
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
65 </para>
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
66
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
67 <para>
253
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
68 Для работы AIO нужно выключить
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
69 <link id="sendfile"/>:
76
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
70 <example>
253
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
71 location /video/ {
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
72 sendfile off;
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
73 aio on;
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
74 output_buffers 1 64k;
76
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
75 }
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
76 </example>
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
77 </para>
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
78
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
79 <para>
253
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
80 Кроме того, начиная с FreeBSD&nbsp;5.2.1 и nginx&nbsp;0.8.12, AIO также можно
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
81 использовать для подгрузки данных для <c-func>sendfile</c-func>:
76
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
82 <example>
253
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
83 location /video/ {
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
84 sendfile on;
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
85 tcp_nopush on;
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
86 aio sendfile;
76
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
87 }
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
88 </example>
253
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
89 В такой конфигурации функция <c-func>sendfile</c-func> вызывается с флагом
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
90 <c-def>SF_NODISKIO</c-def>, в результате она не блокируется на диске, а
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
91 сообщает об отсутствии данных в памяти, после чего nginx инициирует
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
92 асинхронную подгрузку данных, читая только один байт.
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
93 При этом ядро FreeBSD подгружает в память первые 128K байт файла, однако
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
94 при последующих чтениях файл подгружается частями только по 16K.
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
95 Изменить это можно с помощью директивы
106
56457a474903 If text of the link is not provided, the @id is used.
Ruslan Ermilov <ru@nginx.com>
parents: 102
diff changeset
96 <link id="read_ahead"/>.
76
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
97 </para>
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
98
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
99 <para>
253
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
100 В Linux AIO можно использовать только начиная с версии ядра 2.6.22, и,
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
101 кроме того, ещё необходимо дополнительно включать
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
102 <link id="directio"/>,
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
103 иначе чтение будет блокирующимся:
76
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
104 <example>
253
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
105 location /video/ {
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
106 aio on;
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
107 directio 512;
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
108 output_buffers 1 128k;
76
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
109 }
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
110 </example>
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
111 </para>
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
112
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
113 <para>
253
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
114 Поскольку
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
115 <link id="directio"/>
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
116 в Linux можно использовать только для чтения блоков, выравненных
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
117 на границу 512 байт (или 4К для XFS), то невыравненный конец файла
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
118 будет читаться блокированно.
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
119 То же относится к запросам с указанием диапазона запрашиваемых байт
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
120 (byte-range requests) и к запросам FLV не с начала файла: чтение
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
121 невыравненных начала и конца ответа будет блокирующимся.
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
122 Явно выключать
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
123 <link id="sendfile"/>
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
124 не нужно, так как при использовании
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
125 <link id="directio"/>
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
126 он выключается автоматически.
76
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
127 </para>
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
128
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
129 </directive>
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
130
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
131
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
132 <directive name="alias">
253
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
133 <syntax><argument>путь</argument></syntax>
99
1d315ef37215 The case <default/> is now language-agnostic.
Ruslan Ermilov <ru@nginx.com>
parents: 79
diff changeset
134 <default/>
76
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
135 <context>location</context>
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
136
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
137 <para>
253
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
138 Задаёт замену для указанного location'а.
76
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
139 Например, при такой конфигурации
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
140 <example>
253
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
141 location /i/ {
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
142 alias /data/w3/images/;
76
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
143 }
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
144 </example>
253
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
145 на запрос
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
146 “<code>/i/top.gif</code>” будет отдан файл
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
147 <path>/data/w3/images/top.gif</path>.
76
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
148 </para>
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 <para>
253
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
151 В значении аргумента <argument>путь</argument> можно использовать переменные,
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
152 кроме <var>$document_root</var> и <var>$realpath_root</var>.
76
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
153 </para>
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
154
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
155 <para>
253
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
156 Если <code>alias</code> используется внутри location'а, заданного
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
157 регулярным выражением, то регулярное выражение должно содержать
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
158 выделения, а сам <code>alias</code> — ссылки на эти выделения
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
159 (0.7.40), например:
76
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
160 <example>
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
161 location ~ ^/users/(.+\.(?:gif|jpe?g|png))$ {
253
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
162 alias /data/w3/images/$1;
76
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
163 }
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
164 </example>
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
165 </para>
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
166
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
167 <para>
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
168 Если location и последняя часть значения директивы совпадают:
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
169 <example>
253
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
170 location /images/ {
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
171 alias /data/w3/images/;
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
172 }
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
173 </example>
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
174 то лучше воспользоваться директивой
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
175 <link id="root"/>:
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
176 <example>
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
177 location /images/ {
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
178 root /data/w3;
76
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
179 }
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
180 </example>
253
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
181 </para>
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
182
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
183 </directive>
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
184
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
185
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
186 <directive name="chunked_transfer_encoding">
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
187 <syntax><value>on</value> | <value>off</value></syntax>
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
188 <default>on</default>
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
189 <context>http</context>
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
190 <context>server</context>
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
191 <context>location</context>
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
192
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
193 <para>
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
194 Позволяет запретить формат передачи данных частями (chunked transfer
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
195 encoding) в HTTP/1.1.
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
196 Это может понадобиться при использовании программ, не поддерживающих
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
197 chunked encoding, несмотря на требования стандарта.
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
198 </para>
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
199
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
200 </directive>
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
201
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
202
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
203 <directive name="client_body_buffer_size">
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
204
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
205 <syntax><argument>размер</argument></syntax>
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
206 <default>8k|16k</default>
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
207 <context>http</context>
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
208 <context>server</context>
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
209 <context>location</context>
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
210
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
211 <para>
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
212 Задаёт размер буфера для чтения тела запроса клиента.
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
213 Если тело запроса больше заданного буфера,
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
214 то всё тело запроса или только его часть записывается во
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
215 <link id="client_body_temp_path">временный файл</link>.
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
216 По умолчанию размер одного буфера равен двум размерам страницы.
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
217 На x86, других 32-битных платформах и x86-64 это 8K.
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
218 На других 64-битных платформах это обычно 16K.
76
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
219 </para>
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
220
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
221 </directive>
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
222
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
223
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
224 <directive name="client_body_in_file_only">
253
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
225 <syntax>
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
226 <value>on</value> |
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
227 <value>clean</value> |
270
945d7299c26c Spaces are now preserved here, so removed all the hacks.
Ruslan Ermilov <ru@nginx.com>
parents: 253
diff changeset
228 <value>off</value></syntax>
102
c76a257f3fd4 The directive name is now automatically printed in <default> and <syntax>.
Ruslan Ermilov <ru@nginx.com>
parents: 99
diff changeset
229 <default>off</default>
253
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
230 <context>http</context>
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
231 <context>server</context>
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
232 <context>location</context>
76
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
233
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
234 <para>
253
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
235 Определяет, сохранять ли всё тело запроса клиента в файл.
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
236 Директиву можно использовать для отладки и при использовании переменной
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
237 <var>$request_body_file</var>
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
238 или метода
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
239 <link doc="ngx_http_perl_module.xml" id="methods">$r->request_body_file</link>
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
240 модуля
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
241 <link doc="ngx_http_perl_module.xml">ngx_http_perl_module</link>.
76
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
242 </para>
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
243
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
244 <para>
253
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
245 При установке значения <value>on</value> временные файлы
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
246 по окончании обработки запроса не удаляются.
76
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
247 </para>
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
248
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
249 <para>
253
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
250 Значение <value>clean</value> разрешает удалять временные файлы,
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
251 оставшиеся по окончании обработки запроса.
76
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
252 </para>
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
253
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
254 </directive>
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
255
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
256
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
257 <directive name="client_body_in_single_buffer">
270
945d7299c26c Spaces are now preserved here, so removed all the hacks.
Ruslan Ermilov <ru@nginx.com>
parents: 253
diff changeset
258 <syntax><value>on</value> | <value>off</value></syntax>
102
c76a257f3fd4 The directive name is now automatically printed in <default> and <syntax>.
Ruslan Ermilov <ru@nginx.com>
parents: 99
diff changeset
259 <default>off</default>
253
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
260 <context>http</context>
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
261 <context>server</context>
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
262 <context>location</context>
76
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
263
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
264 <para>
253
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
265 Определяет, сохранять ли всё тело запроса клиента в одном буфере.
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
266 Директива рекомендуется при использовании переменной
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
267 <var>$request_body</var>
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
268 для уменьшения требуемого числа операций копирования.
76
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
269 </para>
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
270
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
271 </directive>
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
272
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
273
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
274 <directive name="client_body_temp_path">
253
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
275 <syntax>
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
276 <argument>путь</argument>
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
277 [<argument>уровень1</argument>
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
278 [<argument>уровень2</argument>
270
945d7299c26c Spaces are now preserved here, so removed all the hacks.
Ruslan Ermilov <ru@nginx.com>
parents: 253
diff changeset
279 [<argument>уровень3</argument>]]]</syntax>
102
c76a257f3fd4 The directive name is now automatically printed in <default> and <syntax>.
Ruslan Ermilov <ru@nginx.com>
parents: 99
diff changeset
280 <default>client_body_temp</default>
253
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
281 <context>http</context>
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
282 <context>server</context>
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
283 <context>location</context>
76
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
284
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
285 <para>
253
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
286 Задаёт каталог для хранения временных файлов с телами запросов клиентов.
76
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
287 В каталоге может использоваться иерархия подкаталогов до трёх уровней.
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
288 Например, при такой конфигурации
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
289 <example>
253
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
290 client_body_temp_path /spool/nginx/client_temp 1 2;
76
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
291 </example>
253
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
292 временный файл будет следующего вида:
76
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
293 <example>
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
294 /spool/nginx/client_temp/7/45/00000123457
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
295 </example>
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
296 </para>
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
297
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
298 </directive>
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
299
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
300
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
301 <directive name="client_body_timeout">
253
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
302 <syntax><argument>время</argument></syntax>
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
303 <default>60s</default>
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
304 <context>http</context>
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
305 <context>server</context>
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
306 <context>location</context>
76
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
307
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
308 <para>
253
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
309 Задаёт таймаут при чтении тела запроса клиента.
76
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
310 Таймаут устанавливается не на всю передачу тела запроса,
253
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
311 а только между двумя последовательными операциями чтения.
76
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
312 Если по истечении этого времени клиент ничего не передаст,
253
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
313 то клиенту возвращается ошибка
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
314 <http-status code="408" text="Request Time-out"/>.
76
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
315 </para>
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
316
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
317 </directive>
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
318
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
319
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
320 <directive name="client_header_buffer_size">
253
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
321 <syntax><argument>размер</argument></syntax>
102
c76a257f3fd4 The directive name is now automatically printed in <default> and <syntax>.
Ruslan Ermilov <ru@nginx.com>
parents: 99
diff changeset
322 <default>1k</default>
253
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
323 <context>http</context>
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
324 <context>server</context>
76
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
325
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
326 <para>
253
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
327 Задаёт размер буфера для чтения заголовка запроса клиента.
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
328 Для большинства запросов достаточно буфера размером в 1K байт.
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
329 Однако если в запросе есть длинные cookies, или же запрос
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
330 пришёл от WAP-клиента, то он может не поместиться в 1K.
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
331 Поэтому, если строка запроса или поле заголовка запроса
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
332 не помещаются полностью в этот буфер, то выделяются буферы
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
333 большего размера, задаваемые директивой
76
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
334 <link id="large_client_header_buffers"/>.
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
335 </para>
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
336
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
337 </directive>
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
338
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
339
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
340 <directive name="client_header_timeout">
253
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
341 <syntax><argument>время</argument></syntax>
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
342 <default>60s</default>
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
343 <context>http</context>
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
344 <context>server</context>
76
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
345
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
346 <para>
253
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
347 Задаёт таймаут при чтении заголовка запроса клиента.
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
348 Если по истечении этого времени клиент не передаст полностью заголовок,
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
349 то клиенту возвращается ошибка
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
350 <http-status code="408" text="Request Time-out"/>.
76
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
351 </para>
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
352
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
353 </directive>
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
354
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
355
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
356 <directive name="client_max_body_size">
253
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
357 <syntax><argument>размер</argument></syntax>
102
c76a257f3fd4 The directive name is now automatically printed in <default> and <syntax>.
Ruslan Ermilov <ru@nginx.com>
parents: 99
diff changeset
358 <default>1m</default>
253
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
359 <context>http</context>
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
360 <context>server</context>
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
361 <context>location</context>
76
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
362
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
363 <para>
253
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
364 Задаёт максимально допустимый размер тела запроса клиента,
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
365 указываемый в поле
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
366 <header>Content-Length</header>
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
367 заголовка запроса.
76
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
368 Если размер больше заданного, то клиенту возвращается ошибка
253
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
369 <http-status code="413" text="Request Entity Too Large"/>.
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
370 Следует иметь в виду, что
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
371 <!--link doc="/web/upload.xml"-->браузеры не умеют корректно показывать
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
372 эту ошибку<!--/link-->.
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
373 Установка аргумента <argument>размер</argument> в 0 отключает
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
374 проверку размера тела запроса клиента.
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
375 </para>
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
376
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
377 </directive>
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
378
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
379
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
380 <directive name="connection_pool_size">
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
381 <syntax><argument>размер</argument></syntax>
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
382 <default>256</default>
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
383 <context>http</context>
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
384 <context>server</context>
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
385
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
386 <para>
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
387 Позволяет производить точную настройку выделений памяти
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
388 под конкретные соединения.
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
389 Эта директива не оказывает существенного влияния на
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
390 производительность и её не следует использовать.
76
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
391 </para>
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
392
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
393 </directive>
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
394
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
395
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
396 <directive name="default_type">
253
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
397 <syntax><argument>mime-тип</argument></syntax>
102
c76a257f3fd4 The directive name is now automatically printed in <default> and <syntax>.
Ruslan Ermilov <ru@nginx.com>
parents: 99
diff changeset
398 <default>text/plain</default>
253
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
399 <context>http</context>
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
400 <context>server</context>
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
401 <context>location</context>
76
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
402
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
403 <para>
253
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
404 Задаёт MIME-тип ответов по умолчанию.
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
405 См. также директиву <link id="types"/>.
76
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
406 </para>
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
407
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
408 </directive>
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
409
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
410
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
411 <directive name="directio">
253
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
412 <syntax><argument>размер</argument> | <value>off</value></syntax>
102
c76a257f3fd4 The directive name is now automatically printed in <default> and <syntax>.
Ruslan Ermilov <ru@nginx.com>
parents: 99
diff changeset
413 <default>off</default>
253
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
414 <context>http</context>
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
415 <context>server</context>
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
416 <context>location</context>
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
417 <appeared-in>0.7.7</appeared-in>
76
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
418
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
419 <para>
253
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
420 Разрешает использовать флаги
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
421 <c-def>O_DIRECT</c-def> (FreeBSD, Linux),
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
422 <c-def>F_NOCACHE</c-def> (Mac OS X)
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
423 или функцию <c-func>directio</c-func> (Solaris)
76
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
424 при чтении файлов, размер которых больше либо равен указанному.
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
425 Директива автоматически запрещает (0.7.15) использование
253
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
426 <link id="sendfile"/>
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
427 для данного запроса.
76
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
428 Рекомендуется использовать для больших файлов:
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
429 <example>
253
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
430 directio 4m;
76
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
431 </example>
106
56457a474903 If text of the link is not provided, the @id is used.
Ruslan Ermilov <ru@nginx.com>
parents: 102
diff changeset
432 или при использовании <link id="aio"/> в Linux.
76
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
433 </para>
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
434
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
435 </directive>
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
436
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
437
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
438 <directive name="directio_alignment">
253
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
439 <syntax><argument>размер</argument></syntax>
102
c76a257f3fd4 The directive name is now automatically printed in <default> and <syntax>.
Ruslan Ermilov <ru@nginx.com>
parents: 99
diff changeset
440 <default>512</default>
253
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
441 <context>http</context>
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
442 <context>server</context>
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
443 <context>location</context>
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
444 <appeared-in>0.8.11</appeared-in>
76
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
445
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
446 <para>
253
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
447 Устанавливает выравнивание для
106
56457a474903 If text of the link is not provided, the @id is used.
Ruslan Ermilov <ru@nginx.com>
parents: 102
diff changeset
448 <link id="directio"/>.
253
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
449 В большинстве случаев достаточно 512-байтового выравнивания, однако
76
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
450 при использовании XFS под Linux его нужно увеличить до 4K.
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
451 </para>
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
452
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
453 </directive>
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
454
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
455
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
456 <directive name="error_page">
253
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
457 <syntax>
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
458 <argument>код</argument> ...
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
459 [<value>=</value>[<argument>ответ</argument>]]
270
945d7299c26c Spaces are now preserved here, so removed all the hacks.
Ruslan Ermilov <ru@nginx.com>
parents: 253
diff changeset
460 <argument>uri</argument></syntax>
99
1d315ef37215 The case <default/> is now language-agnostic.
Ruslan Ermilov <ru@nginx.com>
parents: 79
diff changeset
461 <default/>
253
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
462 <context>http</context>
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
463 <context>server</context>
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
464 <context>location</context>
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
465 <context>if в location</context>
76
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
466
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
467 <para>
253
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
468 Задаёт URI, который будет показываться для указанных ошибок.
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
469 Директивы <code>error_page</code> наследуются с предыдущего уровня при условии,
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
470 что на данном уровне не описаны свои директивы
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
471 <code>error_page</code>.
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
472 В значении URI можно использовать переменные.
76
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
473 </para>
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
474
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
475 <para>
253
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
476 Пример:
76
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
477 <example>
253
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
478 error_page 404 /404.html;
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
479 error_page 502 503 504 /50x.html;
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
480 error_page 403 http://example.com/forbidden.html;
76
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
481 </example>
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
482 </para>
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
483
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
484 <para>
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
485 Кроме того, можно поменять код ответа на другой, например:
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
486 <example>
253
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
487 error_page 404 =200 /empty.gif;
76
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
488 </example>
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
489 </para>
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
490
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
491 <para>
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
492 Если ошибочный ответ обрабатывается проксированным сервером или
253
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
493 FastCGI-сервером, и этот сервер может вернуть разные коды ответов,
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
494 например, 200, 302, 401 или 404, то можно выдавать возвращаемый им код:
76
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
495 <example>
253
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
496 error_page 404 = /404.php;
76
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
497 </example>
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
498 </para>
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
499
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
500 <para>
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
501 Если при перенаправлении не нужно менять URI, то можно перенаправить
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
502 обработку ошибки в именованный location:
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
503 <example>
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
504 location / {
253
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
505 error_page 404 = @fallback;
76
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
506 }
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
507
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
508 location @fallback {
253
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
509 proxy_pass http://backend;
76
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
510 }
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
511 </example>
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
512 </para>
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
513
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
514 </directive>
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
515
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
516
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
517 <directive name="if_modified_since">
253
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
518 <syntax>
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
519 <value>off</value> |
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
520 <value>exact</value> |
270
945d7299c26c Spaces are now preserved here, so removed all the hacks.
Ruslan Ermilov <ru@nginx.com>
parents: 253
diff changeset
521 <value>before</value></syntax>
102
c76a257f3fd4 The directive name is now automatically printed in <default> and <syntax>.
Ruslan Ermilov <ru@nginx.com>
parents: 99
diff changeset
522 <default>exact</default>
253
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
523 <context>http</context>
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
524 <context>server</context>
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
525 <context>location</context>
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
526 <appeared-in>0.7.24</appeared-in>
76
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
527
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
528 <para>
253
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
529 Определяет, как сравнивать время модификации ответа с
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
530 временем в поле
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
531 <header>If-Modified-Since</header>
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
532 заголовка запроса:
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
533
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
534 <list type="tag">
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
535
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
536 <tag-name><value>off</value></tag-name>
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
537 <tag-desc>
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
538 не проверять поле
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
539 <header>If-Modified-Since</header> заголовка запроса (0.7.34);
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
540 </tag-desc>
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
541
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
542 <tag-name><value>exact</value></tag-name>
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
543 <tag-desc>
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
544 точное совпадение;
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
545 </tag-desc>
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
546
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
547 <tag-name><value>before</value></tag-name>
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
548 <tag-desc>
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
549 время модификации ответа меньше или равно времени, заданному в поле
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
550 <header>If-Modified-Since</header> заголовка запроса.
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
551 </tag-desc>
76
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
552
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
553 </list>
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
554 </para>
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
555
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
556 </directive>
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
557
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
558
253
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
559 <directive name="ignore_invalid_headers">
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
560 <syntax><value>on</value> | <value>off</value></syntax>
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
561 <default>on</default>
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
562 <context>http</context>
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
563 <context>server</context>
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
564
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
565 <para>
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
566 Если включено, nginx игнорирует поля заголовка с недопустимыми именами.
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
567 Допустимыми считаются имена, состоящие из английских букв, цифр, дефисов
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
568 и возможно знаков подчёркивания (последнее контролируется директивой
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
569 <link id="underscores_in_headers"/>).
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
570 </para>
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
571
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
572 </directive>
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
573
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
574
76
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
575 <directive name="internal">
102
c76a257f3fd4 The directive name is now automatically printed in <default> and <syntax>.
Ruslan Ermilov <ru@nginx.com>
parents: 99
diff changeset
576 <syntax/>
99
1d315ef37215 The case <default/> is now language-agnostic.
Ruslan Ermilov <ru@nginx.com>
parents: 79
diff changeset
577 <default/>
76
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
578 <context>location</context>
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
579
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
580 <para>
253
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
581 Указывает, что location может использоваться только для внутренних запросов.
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
582 Для внешних запросов клиенту будет возвращаться ошибка
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
583 <http-status code="404" text="Not Found"/>.
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
584 Внутренними запросами являются:
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
585
76
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
586 <list type="bullet">
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
587
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
588 <listitem>
253
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
589 запросы, перенаправленные директивой <link id="error_page"/>;
76
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
590 </listitem>
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
591
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
592 <listitem>
253
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
593 подзапросы, формируемые командой
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
594 <command>include virtual</command>
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
595 модуля
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
596 <link doc="ngx_http_ssi_module.xml">ngx_http_ssi_module</link>;
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
597 ngx_http_ssi_module;
76
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
598 </listitem>
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
599
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
600 <listitem>
253
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
601 запросы, изменённые директивой
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
602 <link doc="ngx_http_rewrite_module.xml" id="rewrite"/>.
76
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
603 </listitem>
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
604
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
605 </list>
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
606 </para>
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
607
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
608 <para>
253
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
609 Пример:
76
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
610 <example>
253
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
611 error_page 404 /404.html;
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
612
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
613 location /404.html {
76
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
614 internal;
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
615 }
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
616 </example>
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
617 </para>
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
618
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
619 </directive>
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
620
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
621
253
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
622 <directive name="keepalive_disable">
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
623 <syntax><value>none</value> | <argument>браузер</argument> ...</syntax>
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
624 <default>msie6 safari</default>
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
625 <context>http</context>
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
626 <context>server</context>
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
627 <context>location</context>
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
628
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
629 <para>
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
630 Запрещает keep-alive соединения с некорректно ведущими себя браузерами.
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
631 Аргументы <argument>браузер</argument> указывают, на какие браузеры это
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
632 распространяется.
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
633 Значение <value>msie6</value> запрещает keep-alive соединения
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
634 со старыми версиями MSIE после получения запроса POST.
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
635 Значение <value>safari</value> запрещает keep-alive соединения
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
636 с браузерами Safari.
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
637 Значение <value>none</value> разрешает keep-alive соединения
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
638 со всеми браузерами.
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
639 </para>
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
640
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
641 </directive>
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
642
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
643
76
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
644 <directive name="keepalive_requests">
253
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
645 <syntax><argument>число</argument></syntax>
102
c76a257f3fd4 The directive name is now automatically printed in <default> and <syntax>.
Ruslan Ermilov <ru@nginx.com>
parents: 99
diff changeset
646 <default>100</default>
253
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
647 <context>http</context>
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
648 <context>server</context>
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
649 <context>location</context>
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
650 <appeared-in>0.8.0</appeared-in>
76
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
651
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
652 <para>
253
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
653 Задаёт максимальное число запросов, которые можно
76
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
654 сделать по одному keep-alive соединению.
253
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
655 После того, как будет сделано максимальное число запросов,
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
656 соединение закрывается.
76
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
657 </para>
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
658
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
659 </directive>
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
660
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
661
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
662 <directive name="keepalive_timeout">
253
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
663 <syntax>
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
664 <argument>таймаут</argument>
270
945d7299c26c Spaces are now preserved here, so removed all the hacks.
Ruslan Ermilov <ru@nginx.com>
parents: 253
diff changeset
665 [<argument>заголовок_таймаута</argument>]</syntax>
253
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
666 <default>75s</default>
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
667 <context>http</context>
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
668 <context>server</context>
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
669 <context>location</context>
76
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
670
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
671 <para>
253
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
672 Первый аргумент задаёт таймаут, в течение которого keep-alive
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
673 соединение с клиентом не будет закрыто со стороны сервера.
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
674 Второй необязательный параметр задаёт значение в поле
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
675 <header>Keep-Alive: timeout=<argument>время</argument></header>
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
676 заголовка ответа.
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
677 Два аргумента могут отличаться друг от друга.
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
678 </para>
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
679
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
680 <para>
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
681 Поле
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
682 <header>Keep-Alive: timeout=<argument>время</argument></header>
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
683 заголовка понимают Mozilla и Konqueror.
76
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
684 MSIE сам закрывает keep-alive соединение примерно через 60 секунд.
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
685 </para>
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
686
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
687 </directive>
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
688
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
689
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
690 <directive name="large_client_header_buffers">
270
945d7299c26c Spaces are now preserved here, so removed all the hacks.
Ruslan Ermilov <ru@nginx.com>
parents: 253
diff changeset
691 <syntax><argument>число</argument> <argument>размер</argument></syntax>
253
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
692 <default>4 8k</default>
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
693 <context>http</context>
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
694 <context>server</context>
76
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
695
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
696 <para>
253
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
697 Задаёт максимальное <argument>число</argument> и <argument>размер</argument>
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
698 буферов для чтения большого заголовка запроса клиента.
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
699 Строка запроса не должна превышать размера одного буфера, иначе клиенту
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
700 возвращается ошибка
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
701 <http-status code="414" text="Request-URI Too Large"/>.
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
702 Поле заголовка запроса также не должно превышать размера одного буфера,
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
703 иначе клиенту возвращается ошибка
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
704 <http-status code="400" text="Bad Request"/>.
76
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
705 Буферы выделяются только по мере необходимости.
253
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
706 По умолчанию размер одного буфера равен 8K байт.
76
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
707 Если по окончании обработки запроса соединение переходит в состояние
253
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
708 keep-alive, эти буферы освобождаются.
76
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
709 </para>
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
710
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
711 </directive>
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
712
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
713
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
714 <directive name="limit_except">
253
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
715 <syntax block="yes"><argument>метод</argument> ...</syntax>
99
1d315ef37215 The case <default/> is now language-agnostic.
Ruslan Ermilov <ru@nginx.com>
parents: 79
diff changeset
716 <default/>
76
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
717 <context>location</context>
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
718
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
719 <para>
253
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
720 Ограничивает HTTP-методы, доступные внутри location.
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
721 Аргумент <argument>метод</argument> может быть одним из
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
722 <value>GET</value>,
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
723 <value>HEAD</value>,
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
724 <value>POST</value>,
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
725 <value>PUT</value>,
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
726 <value>DELETE</value>,
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
727 <value>MKCOL</value>,
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
728 <value>COPY</value>,
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
729 <value>MOVE</value>,
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
730 <value>OPTIONS</value>,
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
731 <value>PROPFIND</value>,
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
732 <value>PROPPATCH</value>,
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
733 <value>LOCK</value>,
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
734 <value>UNLOCK</value>
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
735 или
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
736 <value>PATCH</value>.
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
737 Если разрешён метод <value>GET</value>, то метод
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
738 <value>HEAD</value> также будет разрешён.
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
739 Доступ к остальным методам может быть ограничен при помощи директив модулей
79
0a45870d0160 Fixed cross-document links to use doc and id.
Maxim Dounin <mdounin@mdounin.ru>
parents: 76
diff changeset
740 <link doc="ngx_http_access_module.xml">ngx_http_access_module</link>
253
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
741 и
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
742 <link doc="ngx_http_auth_basic_module.xml">ngx_http_auth_basic_module</link>:
76
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
743 <example>
253
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
744 limit_except GET {
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
745 allow 192.168.1.0/32;
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
746 deny all;
76
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
747 }
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
748 </example>
253
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
749 Обратите внимание, что данное ограничение действует для всех методов,
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
750 <emphasis>кроме</emphasis> GET и HEAD.
76
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
751 </para>
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
752
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
753 </directive>
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
754
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
755
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
756 <directive name="limit_rate">
253
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
757 <syntax><argument>скорость</argument></syntax>
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
758 <default>0</default>
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
759 <context>http</context>
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
760 <context>server</context>
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
761 <context>location</context>
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
762 <context>if в location</context>
76
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
763
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
764 <para>
253
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
765 Ограничивает скорость передачи ответа клиенту.
76
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
766 Скорость задаётся в байтах в секунду.
253
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
767 Значение 0 (установка по умолчанию) отключает ограничение скорости.
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
768 <!--
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
769 Чем меньше скорость, тем более аккуратным будет ограничение.
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
770 -->
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
771 Ограничение срабатывает только для одного соединения, то есть если
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
772 клиент откроет 2 соединения, то суммарная скорость будет в 2 раза
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
773 выше заданного ограничения.
76
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
774 </para>
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
775
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
776 <para>
253
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
777 Если необходимо ограничить скорость для части клиентов на уровне
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
778 <link id="server">сервера</link>, то директива <code>limit_rate</code>
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
779 для этого не подходит.
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
780 Вместо этого следует задать желаемое ограничение скорости в переменной
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
781 <var>$limit_rate</var>:
76
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
782 <example>
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
783 server {
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
784
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
785 if ($slow) {
253
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
786 set $limit_rate 4k;
76
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
787 }
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
788
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
789 ...
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
790 }
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
791 </example>
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
792 </para>
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
793
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
794 </directive>
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
795
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
796
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
797 <directive name="limit_rate_after">
253
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
798 <syntax><argument>размер</argument></syntax>
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
799 <default>0</default>
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
800 <context>http</context>
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
801 <context>server</context>
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
802 <context>location</context>
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
803 <context>if в location</context>
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
804 <appeared-in>0.8.0</appeared-in>
76
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
805
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
806 <para>
253
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
807 Задаёт начальный объём данных, после передачи которого начинает
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
808 ограничиваться скорость передачи ответа клиенту.
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
809 </para>
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
810
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
811 <para>
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
812 Пример:
76
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
813 <example>
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
814 location /flv/ {
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
815 flv;
253
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
816 limit_rate_after 500k;
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
817 limit_rate 50k;
76
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
818 }
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
819 </example>
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
820 </para>
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
821
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
822 </directive>
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
823
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
824
253
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
825 <directive name="lingering_close">
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
826 <syntax><value>off</value> | <value>on</value> | <value>always</value></syntax>
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
827 <default>on</default>
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
828 <context>http</context>
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
829 <context>server</context>
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
830 <context>location</context>
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
831 <appeared-in>1.1.0</appeared-in>
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
832 <appeared-in>1.0.6</appeared-in>
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
833
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
834 <para>
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
835 Управляет закрытием соединений с клиентами.
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
836 </para>
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
837
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
838 <para>
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
839 Со значение по умолчанию “<value>on</value>” nginx будет
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
840 <link id="lingering_timeout">ждать</link> и
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
841 <link id="lingering_time">обрабатывать</link> дополнительные данные,
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
842 поступающие от клиента, перед полным закрытием соединения, но только
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
843 если эвристика указывает на то, что клиент может ещё послать данные.
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
844 </para>
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
845
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
846 <para>
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
847 Со значением “<value>always</value>” nginx всегда будет
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
848 ждать и обрабатывать дополнительные данные, поступающие от клиента.
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
849 </para>
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
850
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
851 <para>
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
852 Со значением “<value>off</value>” nginx не будет ждать поступления
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
853 дополнительных данных и сразу же закроет соединение.
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
854 Это нарушает протокол, поэтому не следует это использовать без нужды.
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
855 </para>
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
856
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
857 </directive>
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
858
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
859
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
860 <directive name="lingering_time">
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
861 <syntax><argument>время</argument></syntax>
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
862 <default>30s</default>
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
863 <context>http</context>
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
864 <context>server</context>
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
865 <context>location</context>
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
866
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
867 <para>
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
868 Если действует <link id="lingering_close"/>,
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
869 эта директива задаёт максимальное время, в течение которого nginx
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
870 будет обрабатывать (читать и игнорировать) дополнительные данные,
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
871 поступающие от клиента.
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
872 По прошествии этого времени соединение будет закрыто, даже если
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
873 будут ещё данные.
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
874 </para>
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
875
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
876 </directive>
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
877
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
878
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
879 <directive name="lingering_timeout">
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
880 <syntax><argument>время</argument></syntax>
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
881 <default>5s</default>
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
882 <context>http</context>
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
883 <context>server</context>
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
884 <context>location</context>
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
885
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
886 <para>
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
887 Если действует <link id="lingering_close"/>, эта директива задаёт
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
888 максимальное время ожидания поступления дополнительных данных от клиента.
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
889 Если в течение этого времени данные не были получены, соединение закрывается.
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
890 Иначе данные читаются и игнорируются, затем nginx снова ждёт поступления данных.
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
891 Цикл “ждать-читать-игнорировать” повторяется, но не дольше чем задано
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
892 директивой <link id="lingering_time"/>.
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
893 </para>
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
894
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
895 </directive>
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
896
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
897
76
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
898 <directive name="listen">
253
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
899 <syntax>
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
900 <argument>адрес</argument>[:<argument>порт</argument>]
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
901 [<parameter>default_server</parameter>]
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
902 [<parameter>setfib</parameter>=<argument>число</argument>]
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
903 [<parameter>backlog</parameter>=<argument>число</argument>]
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
904 [<parameter>rcvbuf</parameter>=<argument>размер</argument>]
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
905 [<parameter>sndbuf</parameter>=<argument>размер</argument>]
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
906 [<parameter>accept_filter</parameter>=<argument>фильтр</argument>]
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
907 [<parameter>deferred</parameter>]
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
908 [<parameter>bind</parameter>]
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
909 [<parameter>ipv6only</parameter>=<value>on</value>|<value>off</value>]
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
910 [<parameter>ssl</parameter>]
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
911 [<parameter>so_keepalive</parameter>=<value>on</value>|<value>off</value>|[<argument>keepidle</argument>]:[<argument>keepintvl</argument>]:[<argument>keepcnt</argument>]]</syntax>
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
912 <syntax>
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
913 <argument>порт</argument>
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
914 [<parameter>default_server</parameter>]
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
915 [<parameter>setfib</parameter>=<argument>число</argument>]
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
916 [<parameter>backlog</parameter>=<argument>число</argument>]
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
917 [<parameter>rcvbuf</parameter>=<argument>размер</argument>]
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
918 [<parameter>sndbuf</parameter>=<argument>размер</argument>]
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
919 [<parameter>accept_filter</parameter>=<argument>фильтр</argument>]
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
920 [<parameter>deferred</parameter>]
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
921 [<parameter>bind</parameter>]
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
922 [<parameter>ipv6only</parameter>=<value>on</value>|<value>off</value>]
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
923 [<parameter>ssl</parameter>]
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
924 [<parameter>so_keepalive</parameter>=<value>on</value>|<value>off</value>|[<argument>keepidle</argument>]:[<argument>keepintvl</argument>]:[<argument>keepcnt</argument>]]</syntax>
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
925 <syntax>
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
926 <value>unix:</value><argument>путь</argument>
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
927 [<parameter>default_server</parameter>]
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
928 [<parameter>backlog</parameter>=<argument>число</argument>]
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
929 [<parameter>rcvbuf</parameter>=<argument>размер</argument>]
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
930 [<parameter>sndbuf</parameter>=<argument>размер</argument>]
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
931 [<parameter>accept_filter</parameter>=<argument>фильтр</argument>]
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
932 [<parameter>deferred</parameter>]
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
933 [<parameter>bind</parameter>]
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
934 [<parameter>ssl</parameter>]
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
935 [<parameter>so_keepalive</parameter>=<value>on</value>|<value>off</value>|[<argument>keepidle</argument>]:[<argument>keepintvl</argument>]:[<argument>keepcnt</argument>]]</syntax>
102
c76a257f3fd4 The directive name is now automatically printed in <default> and <syntax>.
Ruslan Ermilov <ru@nginx.com>
parents: 99
diff changeset
936 <default>*:80 | *:8000</default>
76
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
937 <context>server</context>
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
938
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
939 <para>
253
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
940 Задаёт <argument>адрес</argument> и <argument>порт</argument> для IP
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
941 или <argument>путь</argument> для UNIX-сокета,
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
942 на которых сервер будет принимать запросы.
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
943 Можно указать только <argument>адрес</argument>
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
944 или только <argument>порт</argument>.
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
945 Кроме того, <argument>адрес</argument> может быть именем хоста, например:
76
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
946 <example>
253
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
947 listen 127.0.0.1:8000;
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
948 listen 127.0.0.1;
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
949 listen 8000;
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
950 listen *:8000;
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
951 listen localhost:8000;
76
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
952 </example>
253
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
953 IPv6-адреса (0.7.36) задаются в квадратных скобках:
76
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
954 <example>
253
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
955 listen [::]:8000;
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
956 listen [fe80::1];
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
957 </example>
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
958 UNIX-сокеты (0.8.21) задаются при помощи префикса “<code>unix:</code>”:
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
959 <example>
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
960 listen unix:/var/run/nginx.sock;
76
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
961 </example>
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
962 </para>
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
963
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
964 <para>
253
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
965 Если указан только <argument>адрес</argument>, то используется порт 80.
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
966 </para>
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
967
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
968 <para>
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
969 Если директива не указана, то используется либо <code>*:80</code>
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
970 (если nginx работает с привилегиями суперпользователя),
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
971 либо <code>*:8000</code>.
76
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
972 </para>
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
973
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
974 <para>
253
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
975 Если у директивы есть параметр <parameter>default_server</parameter>, то сервер,
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
976 в котором описана эта директива, будет сервером по умолчанию для указанной пары
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
977 <argument>адрес</argument>:<argument>порт</argument>.
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
978 Если же директив с параметром <parameter>default_server</parameter> нет, то
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
979 сервером по умолчанию будет первый сервер, в котором описана пара
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
980 <argument>адрес</argument>:<argument>порт</argument>.
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
981 адрес:порт.
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
982 <note>
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
983 До версии 0.8.21 этот параметр назывался просто
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
984 <parameter>default</parameter>.
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
985 </note>
76
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
986 </para>
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
987
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
988 <para>
253
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
989 В директиве <code>listen</code> можно также указать несколько
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
990 дополнительных параметров, специфичных для системных вызовов
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
991 <c-func>listen</c-func> и <c-func>bind</c-func>.
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
992 Эти параметры можно задать в любой директиве <code>listen</code>,
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
993 но только один раз для указанной пары
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
994 <argument>адрес</argument>:<argument>порт</argument>.
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
995 <note>
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
996 До версии 0.8.21 их можно было указывать лишь в директиве
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
997 <code>listen</code> с параметром <parameter>default</parameter>.
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
998 </note>
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
999 <list type="tag">
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
1000
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
1001 <tag-name>
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
1002 <parameter>setfib</parameter>=<argument>число</argument>
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
1003 </tag-name>
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
1004 <tag-desc>
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
1005 этот параметр (0.8.44) задаёт для слушающего сокета соответствующую
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
1006 таблицу маршрутизации (FIB).
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
1007 В настоящий момент это работает только на FreeBSD.
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
1008 </tag-desc>
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
1009
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
1010 <tag-name>
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
1011 <parameter>backlog</parameter>=<argument>число</argument>
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
1012 </tag-name>
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
1013 <tag-desc>
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
1014 задаёт параметр <parameter>backlog</parameter> в вызове
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
1015 <c-func>listen</c-func>.
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
1016 По умолчанию <parameter>backlog</parameter> равен -1 для FreeBSD
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
1017 и 511 для других платформ.
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
1018 </tag-desc>
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
1019
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
1020 <tag-name>
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
1021 <parameter>rcvbuf</parameter>=<argument>размер</argument>
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
1022 </tag-name>
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
1023 <tag-desc>
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
1024 задаёт параметр <c-def>SO_RCVBUF</c-def> для слушающего сокета
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
1025 </tag-desc>
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
1026
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
1027 <tag-name>
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
1028 <parameter>sndbuf</parameter>=<argument>размер</argument>
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
1029 </tag-name>
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
1030 <tag-desc>
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
1031 задаёт параметр <c-def>SO_SNDBUF</c-def> для слушающего сокета
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
1032 </tag-desc>
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
1033
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
1034 <tag-name>
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
1035 <parameter>accept_filter</parameter>=<argument>фильтр</argument>
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
1036 </tag-name>
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
1037 <tag-desc>
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
1038 задаёт название accept-фильтра.
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
1039 Работает только на FreeBSD, можно использовать два фильтра —
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
1040 <value>dataready</value> и <value>httpready</value>.
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
1041 По сигналу <c-def>SIGHUP</c-def> accept-фильтр можно менять только в
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
1042 последних версиях FreeBSD, начиная с 6.0, 5.4-STABLE и 4.11-STABLE.
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
1043 </tag-desc>
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
1044
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
1045 <tag-name>
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
1046 <parameter>deferred</parameter>
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
1047 </tag-name>
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
1048 <tag-desc>
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
1049 указывает использовать отложенный <c-func>accept</c-func> на Linux
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
1050 с помощью опции <c-def>TCP_DEFER_ACCEPT</c-def>.
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
1051 </tag-desc>
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
1052
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
1053 <tag-name>
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
1054 <parameter>bind</parameter>
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
1055 </tag-name>
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
1056 <tag-desc>
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
1057 указывает, что для данной пары
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
1058 <argument>адрес</argument>:<argument>порт</argument> нужно делать
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
1059 <c-func>bind</c-func> отдельно.
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
1060 Дело в том, что если описаны несколько директив <code>listen</code>
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
1061 с одинаковым портом, но разными адресами и одна из директив
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
1062 <code>listen</code> слушает на всех адресах для данного порта
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
1063 (<code>*</code>:<argument>порт</argument>, то nginx сделает
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
1064 <c-func>bind</c-func> только на <code>*</code>:<argument>порт</argument>.
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
1065 Необходимо заметить, что в этом случае для определения адреса, на которой
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
1066 пришло соединение, делается системный вызов <c-func>getsockname</c-func>.
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
1067 Если же используются параметры <parameter>backlog</parameter>,
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
1068 <parameter>rcvbuf</parameter>, <parameter>sndbuf</parameter>,
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
1069 <parameter>accept_filter</parameter>, <parameter>deferred</parameter>
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
1070 или <parameter>so_keepalive</parameter>, то для данной пары
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
1071 <argument>адрес</argument>:<argument>порт</argument> всегда делается
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
1072 отдельный вызов <c-func>bind</c-func>.
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
1073 </tag-desc>
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
1074
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
1075 <tag-name>
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
1076 <parameter>ipv6only</parameter>=<value>on</value>|<value>off</value>
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
1077 </tag-name>
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
1078 <tag-desc>
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
1079 параметр (0.7.42) задаёт значение параметра <c-def>IPV6_V6ONLY</c-def>
76
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
1080 для слушающего сокета.
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
1081 Установить этот параметр можно только один раз на старте.
253
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
1082 </tag-desc>
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
1083
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
1084 <tag-name>
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
1085 <parameter>ssl</parameter>
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
1086 </tag-name>
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
1087 <tag-desc>
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
1088 этот параметр (0.7.14) не имеет отношения к системным вызовам
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
1089 <c-func>listen</c-func> и <c-func>bind</c-func>, а позволяет указать,
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
1090 что все соединения, принимаемые на этом порту, должны работать
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
1091 в режиме SSL.
76
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
1092 Это позволяет задать компактную конфигурацию для сервера,
253
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
1093 работающего сразу в двух режимах — HTTP и HTTPS.
76
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
1094 <example>
253
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
1095 listen 80;
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
1096 listen 443 default ssl;
76
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
1097 </example>
253
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
1098 </tag-desc>
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
1099
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
1100 <tag-name>
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
1101 <parameter>so_keepalive</parameter>=<value>on</value>|<value>off</value>|[<argument>keepidle</argument>]:[<argument>keepintvl</argument>]:[<argument>keepcnt</argument>]
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
1102 </tag-name>
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
1103 <tag-desc>
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
1104 этот параметр (1.1.11) конфигурирует для слушающего сокета
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
1105 поведение “TCP keepalive”.
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
1106 Если этот параметр опущен, то для сокета будут действовать
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
1107 стандартные системные настройки.
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
1108 Если он установлен в значение “<value>on</value>”, то для сокета
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
1109 включается опция <c-def>SO_KEEPALIVE</c-def>.
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
1110 Если он установлен в значение “<value>off</value>”, то для сокета
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
1111 опция <c-def>SO_KEEPALIVE</c-def> выключается.
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
1112 Некоторые операционные системы поддерживают настройку параметров
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
1113 “TCP keepalive” на уровне сокета посредством опций
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
1114 <c-def>TCP_KEEPIDLE</c-def>, <c-def>TCP_KEEPINTVL</c-def> и
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
1115 <c-def>TCP_KEEPCNT</c-def>.
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
1116 На таких системах (в настоящий момент это Linux 2.4+ и NetBSD 5+)
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
1117 их можно сконфигурировать с помощью аргументов <argument>keepidle</argument>,
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
1118 <argument>keepintvl</argument> и <argument>keepcnt</argument>.
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
1119 Один или два аргумента могут быть опущены, в таком случае для
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
1120 соответствующей опции сокета будут действовать стандартные
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
1121 системные настройки.
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
1122 Например,
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
1123 <example>so_keepalive=30m::10</example>
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
1124 установит таймаут бездействия (<c-def>TCP_KEEPIDLE</c-def>) в 30 минут,
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
1125 для интервала проб (<c-def>TCP_KEEPINTVL</c-def>) будет действовать
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
1126 стандартная системная настройка, а счётчик проб (<c-def>TCP_KEEPCNT</c-def>)
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
1127 будет равен 10.
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
1128 </tag-desc>
76
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
1129
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
1130 </list>
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
1131 </para>
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
1132
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
1133 <para>
253
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
1134 Пример:
76
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
1135 <example>
253
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
1136 listen 127.0.0.1 default accept_filter=dataready backlog=1024;
76
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
1137 </example>
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
1138 </para>
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
1139
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
1140 </directive>
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
1141
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
1142
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
1143 <directive name="location">
253
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
1144 <syntax block="yes">[
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
1145 <value>=</value> |
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
1146 <value>~</value> |
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
1147 <value>~*</value> |
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
1148 <value>^~</value>
270
945d7299c26c Spaces are now preserved here, so removed all the hacks.
Ruslan Ermilov <ru@nginx.com>
parents: 253
diff changeset
1149 ] <argument>uri</argument></syntax>
253
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
1150 <syntax block="yes"><value>@</value><argument>имя</argument></syntax>
99
1d315ef37215 The case <default/> is now language-agnostic.
Ruslan Ermilov <ru@nginx.com>
parents: 79
diff changeset
1151 <default/>
76
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
1152 <context>server</context>
253
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
1153 <context>location</context>
76
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
1154
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
1155 <para>
253
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
1156 Устанавливает конфигурацию в зависимости от URI запроса.
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
1157 location можно задать префиксной строкой или регулярным выражением.
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
1158 Регулярные выражения задаются либо с префиксом “<value>~*</value>”
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
1159 (для поиска совпадения без учёта регистра символов),
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
1160 либо с префиксом “<value>~</value>” (с учётом регистра).
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
1161 Чтобы найти location, соответствующий запросу, вначале проверяются
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
1162 location'ы, заданные префиксными строками (префиксные location'ы).
76
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
1163 Среди них ищется максимальное совпадение.
253
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
1164 Затем проверяются регулярные выражения, в порядке их следования
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
1165 в конфигурационном файле.
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
1166 Проверка регулярных выражений прекращается после первого же совпадения,
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
1167 и используется соответствующая конфигурация.
76
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
1168 Если совпадение с регулярным выражением не найдено, то используется
253
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
1169 конфигурация максимально совпавшего префиксного location'а.
76
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
1170 </para>
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
1171
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
1172 <para>
253
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
1173 location'ы могут быть вложенными, с некоторыми исключениями,
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
1174 о которых говорится ниже.
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
1175 </para>
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
1176
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
1177 <para>
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
1178 Для операционных систем, нечувствительных к регистру символов, таких
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
1179 как Mac OS X и Cygwin, сравнение с префиксными строками производится
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
1180 без учёта регистра (0.7.7).
76
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
1181 Однако, сравнение ограничено только однобайтными locale'ями.
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
1182 </para>
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
1183
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
1184 <para>
253
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
1185 Регулярные выражения могут содержать выделения (0.7.40), которые могут
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
1186 затем использоваться в других директивах.
76
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
1187 </para>
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
1188
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
1189 <para>
253
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
1190 Если у максимального совпавшего префиксного location'а указан префикс
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
1191 “<value>^~</value>”, то регулярные выражения не проверяются.
76
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
1192 </para>
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
1193
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
1194 <para>
253
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
1195 Кроме того, с помощью префикса “<value>=</value>” можно задать точное
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
1196 совпадение URI и location.
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
1197 При точном совпадении поиск сразу же прекращается.
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
1198 Например, если запрос “<code>/</code>” случается часто, то
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
1199 указав “<code>location = /</code>”, можно ускорить обработку
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
1200 этих запросов, так как поиск прекратится после первого же сравнения.
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
1201 Очевидно, что такой location не может иметь вложенные location'ы.
76
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
1202 </para>
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
1203
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
1204 <para>
253
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
1205 <note>
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
1206 В версиях с 0.7.1 по 0.8.41, если запрос точно совпал с префиксным
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
1207 location'ом без префиксов “<value>=</value>” и “<value>^~</value>”,
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
1208 то поиск тоже сразу же прекращается и регулярные выражения также
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
1209 не проверяются.
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
1210 </note>
76
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
1211 </para>
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
1212
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
1213 <para>
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
1214 Проиллюстрируем вышесказанное примером:
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
1215 <example>
253
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
1216 location = / {
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
1217 [ конфигурация А ]
76
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
1218 }
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
1219
253
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
1220 location / {
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
1221 [ конфигурация Б ]
76
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
1222 }
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
1223
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
1224 location ^~ /images/ {
253
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
1225 [ конфигурация В ]
76
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
1226 }
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
1227
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
1228 location ~* \.(gif|jpg|jpeg)$ {
253
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
1229 [ конфигурация Г ]
76
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
1230 }
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
1231 </example>
253
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
1232 Для запроса “<code>/</code>” будет выбрана конфигурация А,
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
1233 для запроса “<code>/documents/document.html</code>” — конфигурация Б,
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
1234 для запроса “<code>/images/1.gif</code>” — конфигурация В,
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
1235 а для запроса “<code>/documents/1.jpg</code>” — конфигурация Г.
76
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
1236 </para>
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
1237
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
1238 <para>
253
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
1239 Префикс “<value>@</value>” задаёт именованный location.
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
1240 Такой location не используется при обычной обработке запросов, а
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
1241 предназначен только для перенаправления в него запросов.
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
1242 Такие location'ы не могут быть вложенными и не могут содержать
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
1243 вложенные location'ы.
76
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
1244 </para>
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
1245
253
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
1246 <!--
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
1247 <migration from="Apache" directive="Location" />
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
1248 -->
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
1249
76
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
1250 </directive>
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
1251
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
1252
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
1253 <directive name="log_not_found">
253
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
1254 <syntax><value>on</value> | <value>off</value></syntax>
102
c76a257f3fd4 The directive name is now automatically printed in <default> and <syntax>.
Ruslan Ermilov <ru@nginx.com>
parents: 99
diff changeset
1255 <default>on</default>
253
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
1256 <context>http</context>
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
1257 <context>server</context>
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
1258 <context>location</context>
76
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
1259
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
1260 <para>
253
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
1261 Разрешает или запрещает записывать в
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
1262 <link doc="../ngx_core_module.xml" id="error_log"/>
76
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
1263 ошибки о том, что файл не найден.
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
1264 </para>
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
1265
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
1266 </directive>
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
1267
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
1268
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
1269 <directive name="log_subrequest">
253
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
1270 <syntax><value>on</value> | <value>off</value></syntax>
102
c76a257f3fd4 The directive name is now automatically printed in <default> and <syntax>.
Ruslan Ermilov <ru@nginx.com>
parents: 99
diff changeset
1271 <default>off</default>
253
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
1272 <context>http</context>
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
1273 <context>server</context>
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
1274 <context>location</context>
76
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
1275
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
1276 <para>
253
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
1277 Разрешает или запрещает записывать в
106
56457a474903 If text of the link is not provided, the @id is used.
Ruslan Ermilov <ru@nginx.com>
parents: 102
diff changeset
1278 <link doc="ngx_http_log_module.xml" id="access_log"/>
76
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
1279 подзапросы.
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
1280 </para>
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
1281
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
1282 </directive>
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
1283
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
1284
253
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
1285 <directive name="max_ranges">
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
1286 <syntax><argument>число</argument></syntax>
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
1287 <default/>
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
1288 <context>http</context>
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
1289 <context>server</context>
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
1290 <context>location</context>
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
1291
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
1292 <para>
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
1293 Ограничивает максимальное допустимое число диапазонов в запросах с
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
1294 указанием диапазона запрашиваемых байт (byte-range requests).
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
1295 Запросы, превышающие указанное ограничение, обрабатываются как
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
1296 если бы они не содержали указания диапазонов.
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
1297 По умолчанию ограничения нет.
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
1298 Значение 0 полностью запрещает поддержку диапазонов.
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
1299 </para>
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
1300
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
1301 </directive>
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
1302
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
1303
76
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
1304 <directive name="merge_slashes">
253
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
1305 <syntax><value>on</value> | <value>off</value></syntax>
102
c76a257f3fd4 The directive name is now automatically printed in <default> and <syntax>.
Ruslan Ermilov <ru@nginx.com>
parents: 99
diff changeset
1306 <default>on</default>
253
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
1307 <context>http</context>
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
1308 <context>server</context>
76
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
1309
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
1310 <para>
253
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
1311 Разрешает или запрещает преобразование URI путём замены двух и более подряд
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
1312 идущих слэшей (“<code>/</code>”) в один.
76
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
1313 </para>
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
1314
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
1315 <para>
253
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
1316 Необходимо иметь ввиду, что это преобразование необходимо для корректной
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
1317 проверки префиксных строк и регулярных выражений.
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
1318 Если его не делать, то запрос “<code>//scripts/one.php</code>” не попадёт в
76
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
1319 <example>
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
1320 location /scripts/ {
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
1321 ...
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
1322 }
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
1323 </example>
253
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
1324 и может быть обслужен как статический файл.
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
1325 Поэтому он преобразуется к виду “<code>/scripts/one.php</code>”.
76
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
1326 </para>
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
1327
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
1328 <para>
253
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
1329 Запрет преобразования может понадобиться, если в URI используются имена,
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
1330 закодированные методом base64, в котором задействован символ “<code>/</code>”.
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
1331 Однако по соображениям безопасности лучше избегать отключения преобразования.
76
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
1332 </para>
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
1333
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
1334 <para>
253
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
1335 Если директива указана на уровне
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
1336 <link id="server"/>
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
1337 в сервере по умолчанию, то её значение распространяется на
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
1338 все виртуальные сервера, слушающие на том же адресе и порту.
76
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
1339 </para>
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
1340
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
1341 </directive>
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
1342
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
1343
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
1344 <directive name="msie_padding">
253
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
1345 <syntax><value>on</value> | <value>off</value></syntax>
102
c76a257f3fd4 The directive name is now automatically printed in <default> and <syntax>.
Ruslan Ermilov <ru@nginx.com>
parents: 99
diff changeset
1346 <default>on</default>
253
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
1347 <context>http</context>
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
1348 <context>server</context>
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
1349 <context>location</context>
76
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
1350
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
1351 <para>
253
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
1352 Разрешает или запрещает добавлять в ответы для MSIE со статусом больше 400
76
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
1353 комментарий для увеличения размера ответа до 512 байт.
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
1354 </para>
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
1355
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
1356 </directive>
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
1357
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
1358
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
1359 <directive name="msie_refresh">
253
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
1360 <syntax><value>on</value> | <value>off</value></syntax>
102
c76a257f3fd4 The directive name is now automatically printed in <default> and <syntax>.
Ruslan Ermilov <ru@nginx.com>
parents: 99
diff changeset
1361 <default>off</default>
253
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
1362 <context>http</context>
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
1363 <context>server</context>
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
1364 <context>location</context>
76
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
1365
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
1366 <para>
253
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
1367 Разрешает или запрещает выдавать для MSIE клиентов refresh'ы вместо
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
1368 перенаправлений.
76
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
1369 </para>
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
1370
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
1371 </directive>
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
1372
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
1373
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
1374 <directive name="open_file_cache">
253
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
1375 <syntax><value>off</value></syntax>
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
1376 <syntax>
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
1377 <parameter>max</parameter>=<argument>N</argument>
270
945d7299c26c Spaces are now preserved here, so removed all the hacks.
Ruslan Ermilov <ru@nginx.com>
parents: 253
diff changeset
1378 [<parameter>inactive</parameter>=<argument>время</argument>]</syntax>
102
c76a257f3fd4 The directive name is now automatically printed in <default> and <syntax>.
Ruslan Ermilov <ru@nginx.com>
parents: 99
diff changeset
1379 <default>off</default>
253
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
1380 <context>http</context>
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
1381 <context>server</context>
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
1382 <context>location</context>
76
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
1383
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
1384 <para>
253
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
1385 Задаёт кэш, в котором могут храниться:
76
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
1386 <list type="bullet">
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
1387
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
1388 <listitem>
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
1389 дескрипторы открытых файлов, информация об их размерах и времени модификации;
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
1390 </listitem>
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
1391
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
1392 <listitem>
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
1393 информация о существовании каталогов;
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
1394 </listitem>
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
1395
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
1396 <listitem>
253
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
1397 информация об ошибках поиска файла — “нет файла”, “нет прав на чтение”
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
1398 и тому подобное.
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
1399 <note>
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
1400 Кэширование ошибок нужно разрешить отдельно директивой
76
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
1401 <link id="open_file_cache_errors"/>.
253
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
1402 </note>
76
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
1403 </listitem>
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
1404
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
1405 </list>
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
1406 </para>
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
1407
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
1408 <para>
253
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
1409 У директивы есть следующие параметры:
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
1410 <list type="tag">
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
1411
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
1412 <tag-name>
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
1413 <parameter>max</parameter>
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
1414 </tag-name>
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
1415 <tag-desc>
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
1416 задаёт максимальное число элементов в кэше;
76
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
1417 при переполнении кэша удаляются наиболее давно не используемые элементы (LRU);
253
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
1418 </tag-desc>
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
1419
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
1420 <tag-name>
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
1421 <parameter>inactive</parameter>
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
1422 </tag-name>
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
1423 <tag-desc>
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
1424 задаёт время, после которого элемент кэша удаляется, если к нему
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
1425 не было обращений в течение этого времени; по умолчанию 60 секунд;
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
1426 </tag-desc>
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
1427
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
1428 <tag-name>
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
1429 <value>off</value>
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
1430 </tag-name>
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
1431 <tag-desc>
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
1432 запрещает кэш.
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
1433 </tag-desc>
76
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
1434
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
1435 </list>
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
1436 </para>
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
1437
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
1438 <para>
253
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
1439 Пример:
76
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
1440 <example>
253
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
1441 open_file_cache max=1000 inactive=20s;
76
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
1442 open_file_cache_valid 30s;
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
1443 open_file_cache_min_uses 2;
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
1444 open_file_cache_errors on;
253
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
1445 <!--
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
1446 open_file_cache_events on;
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
1447 -->
76
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
1448 </example>
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
1449 </para>
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
1450
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
1451 </directive>
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
1452
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
1453
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
1454 <directive name="open_file_cache_errors">
253
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
1455 <syntax><value>on</value> | <value>off</value></syntax>
102
c76a257f3fd4 The directive name is now automatically printed in <default> and <syntax>.
Ruslan Ermilov <ru@nginx.com>
parents: 99
diff changeset
1456 <default>off</default>
253
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
1457 <context>http</context>
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
1458 <context>server</context>
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
1459 <context>location</context>
76
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
1460
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
1461 <para>
253
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
1462 Разрешает или запрещает кэширование ошибок поиска файлов в
76
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
1463 <link id="open_file_cache"/>.
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
1464 </para>
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
1465
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
1466 </directive>
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
1467
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
1468
253
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
1469 <!--
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
1470
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
1471 <directive name="open_file_cache_events">
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
1472 <syntax><value>on</value> | <value>off</value></syntax>
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
1473 <default>off</default>
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
1474 <context>http</context>
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
1475 <context>server</context>
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
1476 <context>location</context>
76
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
1477
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
1478 <para>
253
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
1479 Разрешает использование событий ядра для проверки актуальности элементов
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
1480 <link id="open_file_cache"/>.
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
1481 Эта директива работает только совместно с методом
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
1482 <link doc="../events.xml" id="kqueue"/>.
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
1483 Заметьте, что только NetBSD&nbsp;2.0+ и FreeBSD&nbsp;6.0+
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
1484 поддерживают события для файловых систем произвольного типа.
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
1485 Другие операционные системы поддерживают события только для
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
1486 основных файловых систем, таких как UFS или FFS.
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
1487 </para>
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
1488
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
1489 </directive>
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
1490
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
1491 -->
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
1492
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
1493
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
1494 <directive name="open_file_cache_min_uses">
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
1495 <syntax><argument>число</argument></syntax>
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
1496 <default>1</default>
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
1497 <context>http</context>
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
1498 <context>server</context>
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
1499 <context>location</context>
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
1500
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
1501 <para>
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
1502 Задаёт минимальное <argument>число</argument> обращений к файлу
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
1503 в течение времени, заданного параметром <parameter>inactive</parameter>
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
1504 директивы <link id="open_file_cache"/>, после которого дескриптор
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
1505 файла будет оставаться открытым в кэше.
76
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
1506 </para>
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
1507
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
1508 </directive>
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
1509
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
1510
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
1511 <directive name="open_file_cache_valid">
253
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
1512 <syntax><argument>время</argument></syntax>
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
1513 <default>60s</default>
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
1514 <context>http</context>
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
1515 <context>server</context>
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
1516 <context>location</context>
76
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
1517
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
1518 <para>
253
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
1519 Определяет время, через которое следует проверять актуальность информации
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
1520 об элементе в
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
1521 <link id="open_file_cache"/>.
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
1522 <!--
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
1523 При включенном
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
1524 <link id="open_file_cache_events"/>
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
1525 открытые дескрипторы файлов проверяются лишь единожды, а затем обновляются
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
1526 по факту их изменения.
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
1527 -->
76
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
1528 </para>
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
1529
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
1530 </directive>
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
1531
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
1532
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
1533 <directive name="optimize_server_names">
253
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
1534 <syntax><value>on</value> | <value>off</value></syntax>
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
1535 <default>off</default>
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
1536 <context>http</context>
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
1537 <context>server</context>
76
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
1538
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
1539 <para>
253
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
1540 Директива устарела, вместо неё следует использовать директиву
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
1541 <link id="server_name_in_redirect"/>.
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
1542 </para>
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
1543
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
1544 <!--
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
1545 <para>
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
1546 Разрешает или запрещает оптимизировать проверку имени хоста в name-based
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
1547 виртуальных серверах.
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
1548 Проверка в частности влияет на имя хоста, используемого в перенаправлениях.
76
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
1549 Если оптимизация разрешена и все name-based сервера, слушающие на одной
253
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
1550 паре адрес:порт, имеют одинаковую конфигурацию, то во время исполнения запроса
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
1551 имена не проверяются и в перенаправлениях используется первое имя сервера.
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
1552 Если в перенаправлении нужно использовать имя хоста, переданное клиентом,
76
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
1553 то оптимизацию нужно выключить.
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
1554 </para>
253
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
1555 -->
76
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
1556
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
1557 </directive>
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
1558
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
1559
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
1560 <directive name="port_in_redirect">
253
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
1561 <syntax><value>on</value> | <value>off</value></syntax>
102
c76a257f3fd4 The directive name is now automatically printed in <default> and <syntax>.
Ruslan Ermilov <ru@nginx.com>
parents: 99
diff changeset
1562 <default>on</default>
253
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
1563 <context>http</context>
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
1564 <context>server</context>
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
1565 <context>location</context>
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
1566
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
1567 <para>
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
1568 Разрешает или запрещает указывать порт в перенаправлениях, выдаваемых nginx'ом.
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
1569 </para>
76
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
1570
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
1571 <para>
253
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
1572 См. также директиву <link id="server_name_in_redirect"/>.
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
1573 </para>
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
1574
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
1575 </directive>
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
1576
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
1577
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
1578 <directive name="postpone_output">
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
1579 <syntax><argument>размер</argument></syntax>
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
1580 <default>1460</default>
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
1581 <context>http</context>
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
1582 <context>server</context>
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
1583 <context>location</context>
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
1584
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
1585 <para>
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
1586 Если это возможно, то отправка данных клиенту будет отложена пока nginx не
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
1587 накопит по крайней мере указанное количество байт для отправки.
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
1588 Значение 0 запрещает отложенную отправку данных.
76
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
1589 </para>
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
1590
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
1591 </directive>
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
1592
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
1593
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
1594 <directive name="read_ahead">
253
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
1595 <syntax><argument>размер</argument></syntax>
102
c76a257f3fd4 The directive name is now automatically printed in <default> and <syntax>.
Ruslan Ermilov <ru@nginx.com>
parents: 99
diff changeset
1596 <default>0</default>
253
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
1597 <context>http</context>
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
1598 <context>server</context>
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
1599 <context>location</context>
76
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
1600
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
1601 <para>
253
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
1602 Задаёт ядру размер предчтения при работе с файлами.
76
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
1603 </para>
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
1604
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
1605 <para>
253
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
1606 На Linux используется системный вызов
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
1607 <code>posix_fadvise(0, 0, 0, POSIX_FADV_SEQUENTIAL)</code>,
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
1608 поэтому аргумент <argument>размер</argument> там игнорируется.
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
1609 </para>
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
1610
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
1611 <para>
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
1612 На FreeBSD используется системный вызов
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
1613 <code>fcntl(O_READAHEAD,</code><argument>размер</argument><code>)</code>,
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
1614 появившийся во FreeBSD&nbsp;9.0-CURRENT.
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
1615 Для FreeBSD&nbsp;7 необходимо установить
76
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
1616 <link url="http://sysoev.ru/freebsd/patch.readahead.txt">патч</link>.
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
1617 </para>
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
1618
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
1619 </directive>
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
1620
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
1621
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
1622 <directive name="recursive_error_pages">
253
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
1623 <syntax><value>on</value> | <value>off</value></syntax>
102
c76a257f3fd4 The directive name is now automatically printed in <default> and <syntax>.
Ruslan Ermilov <ru@nginx.com>
parents: 99
diff changeset
1624 <default>off</default>
253
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
1625 <context>http</context>
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
1626 <context>server</context>
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
1627 <context>location</context>
76
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
1628
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
1629 <para>
253
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
1630 Разрешает или запрещает делать несколько перенаправлений через директиву
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
1631 <link id="error_page"/>.
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
1632 </para>
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
1633
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
1634 </directive>
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
1635
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
1636
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
1637 <directive name="request_pool_size">
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
1638 <syntax><argument>размер</argument></syntax>
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
1639 <default>4k</default>
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
1640 <context>http</context>
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
1641 <context>server</context>
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
1642
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
1643 <para>
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
1644 Позволяет производить точную настройку выделений памяти
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
1645 под конкретные запросы.
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
1646 Эта директива не оказывает существенного влияния на
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
1647 производительность и её не следует использовать.
76
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
1648 </para>
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
1649
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
1650 </directive>
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
1651
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
1652
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
1653 <directive name="reset_timedout_connection">
253
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
1654 <syntax>
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
1655 <value>on</value> | <value>off</value></syntax>
102
c76a257f3fd4 The directive name is now automatically printed in <default> and <syntax>.
Ruslan Ermilov <ru@nginx.com>
parents: 99
diff changeset
1656 <default>off</default>
253
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
1657 <context>http</context>
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
1658 <context>server</context>
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
1659 <context>location</context>
76
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
1660
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
1661 <para>
253
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
1662 Разрешает или запрещает сброс соединений по таймауту.
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
1663 Сброс делается следующим образом — перед закрытием сокета для него
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
1664 ставится опция
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
1665 <c-def>SO_LINGER</c-def>
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
1666 с таймаутом 0.
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
1667 После чего при закрытии сокета клиенту отсылается TCP RST, а вся память,
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
1668 связанная с этим сокетом, освобождается.
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
1669 Это позволяет избежать длительного нахождения уже закрытого сокета в
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
1670 состоянии FIN_WAIT1 с заполненными буферами.
76
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
1671 </para>
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
1672
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
1673 <para>
253
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
1674 Необходимо отметить, что keep-alive соединения по истечении таймаута
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
1675 закрываются обычным образом.
76
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
1676 </para>
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
1677
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
1678 </directive>
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
1679
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
1680
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
1681 <directive name="resolver">
253
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
1682 <syntax>
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
1683 <argument>адрес</argument> ...
270
945d7299c26c Spaces are now preserved here, so removed all the hacks.
Ruslan Ermilov <ru@nginx.com>
parents: 253
diff changeset
1684 [<parameter>valid</parameter>=<argument>время</argument>]</syntax>
99
1d315ef37215 The case <default/> is now language-agnostic.
Ruslan Ermilov <ru@nginx.com>
parents: 79
diff changeset
1685 <default/>
253
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
1686 <context>http</context>
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
1687 <context>server</context>
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
1688 <context>location</context>
76
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
1689
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
1690 <para>
253
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
1691 Задаёт серверы DNS, используемые для преобразования имён апстрим серверов
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
1692 в адреса, например:
76
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
1693 <example>
253
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
1694 resolver 127.0.0.1 192.0.2.1;
76
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
1695 </example>
253
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
1696 Аргумент <argument>адрес</argument> может быть задан либо
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
1697 IPv4-адресом, либо именем хоста;
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
1698 во втором случае используется первый полученный IPv4-адрес.
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
1699 Серверы DNS опрашиваются циклически.
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
1700 <note>
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
1701 До версии 1.1.7 можно было задать лишь один DNS-сервер.
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
1702 </note>
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
1703 По умолчанию nginx кэширует ответы, используя значение TTL из ответа.
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
1704 Необязательный параметр <parameter>valid</parameter> позволяет это
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
1705 переопределить:
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
1706 <example>
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
1707 resolver 127.0.0.1 192.0.2.1 valid=30s;
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
1708 </example>
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
1709 <note>
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
1710 До версии 1.1.9 настройка времени кэширования была невозможна
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
1711 и nginx всегда кэшировал ответы на срок в 5 минут.
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
1712 </note>
76
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
1713 </para>
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
1714
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
1715 </directive>
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
1716
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
1717
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
1718 <directive name="resolver_timeout">
253
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
1719 <syntax><argument>время</argument></syntax>
102
c76a257f3fd4 The directive name is now automatically printed in <default> and <syntax>.
Ruslan Ermilov <ru@nginx.com>
parents: 99
diff changeset
1720 <default>30s</default>
253
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
1721 <context>http</context>
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
1722 <context>server</context>
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
1723 <context>location</context>
76
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
1724
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
1725 <para>
253
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
1726 Задаёт таймаут для преобразования имени в адрес, например:
76
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
1727 <example>
253
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
1728 resolver_timeout 5s;
76
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
1729 </example>
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
1730 </para>
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
1731
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
1732 </directive>
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
1733
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
1734
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
1735 <directive name="root">
253
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
1736 <syntax><argument>путь</argument></syntax>
102
c76a257f3fd4 The directive name is now automatically printed in <default> and <syntax>.
Ruslan Ermilov <ru@nginx.com>
parents: 99
diff changeset
1737 <default>html</default>
253
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
1738 <context>http</context>
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
1739 <context>server</context>
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
1740 <context>location</context>
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
1741 <context>if в location</context>
76
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
1742
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
1743 <para>
253
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
1744 Задаёт корневой каталог для запросов.
76
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
1745 Например, при такой конфигурации
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
1746 <example>
253
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
1747 location /i/ {
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
1748 root /data/w3;
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
1749 }
76
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
1750 </example>
253
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
1751 в ответ на запрос “<code>/i/top.gif</code>” будет отдан файл
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
1752 <path>/data/w3/i/top.gif</path>.
76
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
1753 </para>
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
1754
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
1755 <para>
253
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
1756 В значении аргумента <argument>путь</argument> можно использовать переменные,
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
1757 кроме <var>$document_root</var> и <var>$realpath_root</var>.
76
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
1758 </para>
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
1759
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
1760 <para>
253
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
1761 Путь к файлу формируется путём простого добавления URI к значению директивы
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
1762 <code>root</code>.
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
1763 Если же URI необходимо поменять, следует воспользоваться директивой
76
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
1764 <link id="alias"/>.
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
1765 </para>
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
1766
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
1767 </directive>
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
1768
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
1769
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
1770 <directive name="satisfy">
253
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
1771 <syntax><value>all</value> | <value>any</value></syntax>
102
c76a257f3fd4 The directive name is now automatically printed in <default> and <syntax>.
Ruslan Ermilov <ru@nginx.com>
parents: 99
diff changeset
1772 <default>all</default>
253
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
1773 <context>http</context>
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
1774 <context>server</context>
76
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
1775 <context>location</context>
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
1776
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
1777 <para>
253
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
1778 Разрешает доступ, если оба (<value>all</value>)
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
1779 или хотя бы один (<value>any</value>) из модулей
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
1780 <link doc="ngx_http_access_module.xml">ngx_http_access_module</link>
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
1781 и <link doc="ngx_http_auth_basic_module.xml">ngx_http_auth_basic_module</link>
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
1782 разрешают доступ.
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
1783 </para>
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
1784
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
1785 <para>
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
1786 Пример:
76
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
1787 <example>
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
1788 location / {
253
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
1789 satisfy any;
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
1790
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
1791 allow 192.168.1.0/32;
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
1792 deny all;
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
1793
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
1794 auth_basic "closed site";
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
1795 auth_basic_user_file conf/htpasswd;
76
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
1796 }
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
1797 </example>
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
1798 </para>
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
1799
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
1800 </directive>
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
1801
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
1802
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
1803 <directive name="satisfy_any">
253
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
1804 <syntax><value>on</value> | <value>off</value></syntax>
102
c76a257f3fd4 The directive name is now automatically printed in <default> and <syntax>.
Ruslan Ermilov <ru@nginx.com>
parents: 99
diff changeset
1805 <default>off</default>
253
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
1806 <context>http</context>
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
1807 <context>server</context>
76
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
1808 <context>location</context>
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
1809
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
1810 <para>
253
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
1811 Эта директива была переименована в директиву
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
1812 <link id="satisfy">satisfy any</link>.
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
1813 </para>
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
1814
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
1815 </directive>
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
1816
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
1817
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
1818 <directive name="send_lowat">
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
1819 <syntax><argument>размер</argument></syntax>
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
1820 <default>0</default>
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
1821 <context>http</context>
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
1822 <context>server</context>
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
1823 <context>location</context>
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
1824
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
1825 <para>
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
1826 При установке в ненулевое значение nginx будет пытаться минимизировать
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
1827 число операций отправки на клиентских сокетах либо при помощи флага
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
1828 <c-def>NOTE_LOWAT</c-def> метода
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
1829 <link doc="../events.xml" id="kqueue"/>,
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
1830 либо при помощи опции сокета <c-def>SO_SNDLOWAT</c-def>,
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
1831 с указанным размером.
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
1832 </para>
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
1833
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
1834 <para>
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
1835 Эта директива игнорируется на Linux, Solaris и Windows.
76
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
1836 </para>
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
1837
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
1838 </directive>
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
1839
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
1840
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
1841 <directive name="send_timeout">
253
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
1842 <syntax><argument>время</argument></syntax>
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
1843 <default>60s</default>
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
1844 <context>http</context>
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
1845 <context>server</context>
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
1846 <context>location</context>
76
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
1847
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
1848 <para>
253
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
1849 Задаёт таймаут при передаче ответа клиенту.
76
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
1850 Таймаут устанавливается не на всю передачу ответа,
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
1851 а только между двумя операциями записями.
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
1852 Если по истечении этого времени клиент ничего не примет,
253
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
1853 соединение будет закрыто.
76
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
1854 </para>
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
1855
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
1856 </directive>
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
1857
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
1858
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
1859 <directive name="sendfile">
253
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
1860
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
1861 <syntax><value>on</value> | <value>off</value></syntax>
102
c76a257f3fd4 The directive name is now automatically printed in <default> and <syntax>.
Ruslan Ermilov <ru@nginx.com>
parents: 99
diff changeset
1862 <default>off</default>
253
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
1863 <context>http</context>
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
1864 <context>server</context>
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
1865 <context>location</context>
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
1866 <context>if в location</context>
76
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
1867
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
1868 <para>
253
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
1869 Разрешает или запрещает использовать
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
1870 <c-func>sendfile</c-func>.
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
1871 </para>
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
1872
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
1873 </directive>
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
1874
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
1875
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
1876 <directive name="sendfile_max_chunk">
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
1877
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
1878 <syntax><argument>размер</argument></syntax>
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
1879 <default>0</default>
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
1880 <context>http</context>
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
1881 <context>server</context>
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
1882 <context>location</context>
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
1883
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
1884 <para>
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
1885 При установке в ненулевое значение ограничивает объём данных,
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
1886 который может передан за один вызов <c-func>sendfile</c-func>.
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
1887 Без этого ограничения одно быстрое соединение может целиком
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
1888 захватить рабочий процесс.
76
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
1889 </para>
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
1890
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
1891 </directive>
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
1892
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
1893
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
1894 <directive name="server">
108
72524ae53106 Explicitly marked directives with the block syntax. Such directives will
Ruslan Ermilov <ru@nginx.com>
parents: 106
diff changeset
1895 <syntax block="yes"/>
99
1d315ef37215 The case <default/> is now language-agnostic.
Ruslan Ermilov <ru@nginx.com>
parents: 79
diff changeset
1896 <default/>
76
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
1897 <context>http</context>
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
1898
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
1899 <para>
253
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
1900 Задаёт конфигурацию для виртуального сервера.
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
1901 Чёткого разделения виртуальных серверов на IP-based (на основании IP-адреса)
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
1902 и name-based (на основании поля <header>Host</header> заголовка запроса) нет.
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
1903 Вместо этого директивами <link id="listen"/> описываются все
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
1904 адреса и порты, на которых нужно принимать соединения для этого сервера,
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
1905 а в директиве <link id="server_name"/> указываются все имена серверов.
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
1906 Пример конфигурации описан в документе по
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
1907 <link doc="../virtual_hosts.xml">
76
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
1908 настройке виртуальных серверов</link>.
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
1909 </para>
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
1910
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
1911 </directive>
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
1912
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
1913
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
1914 <directive name="server_name">
253
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
1915 <syntax><argument>имя</argument> ...</syntax>
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
1916 <default>""</default>
76
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
1917 <context>server</context>
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
1918
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
1919 <para>
253
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
1920 Задаёт имена виртуального сервера, например:
76
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
1921 <example>
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
1922 server {
253
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
1923 server_name example.com www.example.com;
76
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
1924 }
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
1925 </example>
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
1926 </para>
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
1927
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
1928 <para>
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
1929 Первое имя становится основным именем сервера.
253
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
1930 В именах серверов можно использовать звёздочку (“<code>*</code>”)
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
1931 для замены первой или последней части имени:
76
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
1932 <example>
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
1933 server {
253
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
1934 server_name example.com *.example.com www.example.*;
76
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
1935 }
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
1936 </example>
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
1937 </para>
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
1938
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
1939 <para>
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
1940 Два первых вышеприведённых имени можно объединить в одно:
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
1941 <example>
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
1942 server {
253
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
1943 server_name .example.com;
76
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
1944 }
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
1945 </example>
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
1946 </para>
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
1947
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
1948 <para>
253
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
1949 Если аргумент равен “<var>$hostname</var>” (0.9.4), то
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
1950 подставляется имя хоста (hostname) машины.
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
1951 </para>
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
1952
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
1953 <para>
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
1954 В качестве имени сервера можно также использовать регулярное выражение,
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
1955 указав перед ним тильду (“<code>~</code>”):
76
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
1956 <example>
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
1957 server {
253
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
1958 server_name www.example.com ~^www\d+\.example\.com$;
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
1959 }
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
1960 </example>
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
1961 </para>
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
1962
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
1963 <para>
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
1964 Регулярное выражение может содержать выделения (0.7.40),
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
1965 которые могут затем использоваться в других директивах:
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
1966 <example>
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
1967 server {
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
1968 server_name ~^(www\.)?(.+)$;
76
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
1969
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
1970 location / {
253
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
1971 root /sites/$2;
76
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
1972 }
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
1973 }
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
1974
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
1975 server {
253
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
1976 server_name _;
76
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
1977
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
1978 location / {
253
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
1979 root /sites/default;
76
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
1980 }
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
1981 }
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
1982 </example>
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
1983 </para>
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
1984
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
1985 <para>
253
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
1986 Именованные выделения в регулярном выражении создают переменные (0.8.25),
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
1987 которые могут затем использоваться в других директивах:
76
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
1988 <example>
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
1989 server {
253
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
1990 server_name ~^(www\.)?(?&lt;domain&gt;.+)$;
76
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
1991
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
1992 location / {
253
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
1993 root /sites/$domain;
76
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
1994 }
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
1995 }
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
1996
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
1997 server {
253
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
1998 server_name _;
76
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
1999
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
2000 location / {
253
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
2001 root /sites/default;
76
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
2002 }
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
2003 }
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
2004 </example>
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
2005 </para>
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
2006
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
2007 <para>
253
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
2008 Возможно также указать пустое имя сервера (0.7.11):
76
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
2009 <example>
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
2010 server {
253
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
2011 server_name www.example.com "";
76
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
2012 }
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
2013 </example>
253
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
2014 Это позволяет обрабатывать запросы без поля <header>Host</header> заголовка
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
2015 запроса в этом сервере, а не в сервере по умолчанию для данной пары адрес:порт.
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
2016 Это настройка по умолчанию.
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
2017 <note>
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
2018 До 0.8.48 по умолчанию использовалось имя хоста (hostname) машины.
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
2019 </note>
76
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
2020 </para>
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
2021
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
2022 <para>
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
2023 Порядок проверки имён следующий:
253
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
2024 <list type="enum">
76
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
2025
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
2026 <listitem>
253
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
2027 полные имена
76
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
2028 </listitem>
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
2029
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
2030 <listitem>
253
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
2031 имена с маской в начале имени, например “<code>*.example.com</code>”
76
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
2032 </listitem>
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
2033
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
2034 <listitem>
253
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
2035 имена с маской в конце имени, например “<code>mail.*</code>”
76
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
2036 </listitem>
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
2037
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
2038 <listitem>
253
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
2039 регулярные выражения
76
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
2040 </listitem>
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
2041
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
2042 </list>
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
2043 </para>
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
2044
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
2045 </directive>
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
2046
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
2047
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
2048 <directive name="server_name_in_redirect">
253
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
2049 <syntax><value>on</value> | <value>off</value></syntax>
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
2050 <default>off</default>
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
2051 <context>http</context>
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
2052 <context>server</context>
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
2053 <context>location</context>
76
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
2054
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
2055 <para>
253
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
2056 Разрешает или запрещает использовать в перенаправлениях, выдаваемых nginx'ом,
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
2057 основное имя сервера, задаваемое директивой
76
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
2058 <link id="server_name"/>.
253
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
2059 Если запрещено, то используется имя, указанное в поле <header>Host</header>
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
2060 заголовка запроса.
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
2061 Если же этого поля нет, то используется IP-адрес сервера.
76
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
2062 </para>
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
2063
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
2064 <para>
253
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
2065 См. также директиву <link id="port_in_redirect"/>.
76
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
2066 </para>
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
2067
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
2068 </directive>
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
2069
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
2070
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
2071 <directive name="server_names_hash_bucket_size">
253
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
2072 <syntax><argument>размер</argument></syntax>
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
2073 <default>32|64|128</default>
76
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
2074 <context>http</context>
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
2075
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
2076 <para>
253
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
2077 Задаёт размер корзины в хэш-таблицах имён серверов.
76
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
2078 Значение по умолчанию зависит от размера строки кэша процессора.
253
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
2079 Подробнее смотрите в документе по
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
2080 <link doc="../hash.xml">настройке хэшей</link>.
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
2081 </para>
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
2082
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
2083 </directive>
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
2084
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
2085
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
2086 <directive name="server_names_hash_max_size">
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
2087 <syntax><argument>размер</argument></syntax>
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
2088 <default>512</default>
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
2089 <context>http</context>
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
2090
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
2091 <para>
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
2092 Задаёт максимальный <argument>размер</argument> хэш-таблиц имён серверов.
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
2093 Подробнее смотрите в документе по
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
2094 <link doc="../hash.xml">настройке хэшей</link>.
76
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
2095 </para>
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
2096
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
2097 </directive>
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
2098
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
2099
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
2100 <directive name="server_tokens">
253
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
2101 <syntax><value>on</value> | <value>off</value></syntax>
102
c76a257f3fd4 The directive name is now automatically printed in <default> and <syntax>.
Ruslan Ermilov <ru@nginx.com>
parents: 99
diff changeset
2102 <default>on</default>
253
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
2103 <context>http</context>
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
2104 <context>server</context>
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
2105 <context>location</context>
76
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
2106
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
2107 <para>
253
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
2108 Разрешает или запрещает выдавать версию nginx'а в сообщениях об ошибках и
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
2109 в поле <header>Server</header> заголовка ответа.
76
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
2110 </para>
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
2111
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
2112 </directive>
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
2113
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
2114
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
2115 <directive name="tcp_nodelay">
253
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
2116 <syntax><value>on</value> | <value>off</value></syntax>
102
c76a257f3fd4 The directive name is now automatically printed in <default> and <syntax>.
Ruslan Ermilov <ru@nginx.com>
parents: 99
diff changeset
2117 <default>on</default>
253
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
2118 <context>http</context>
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
2119 <context>server</context>
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
2120 <context>location</context>
76
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
2121
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
2122 <para>
253
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
2123 Разрешает или запрещает использование опции <c-def>TCP_NODELAY</c-def>.
76
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
2124 Опция включаются только при переходе соединения в состояние keep-alive.
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
2125 </para>
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
2126
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
2127 </directive>
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
2128
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
2129
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
2130 <directive name="tcp_nopush">
253
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
2131 <syntax><value>on</value> | <value>off</value></syntax>
102
c76a257f3fd4 The directive name is now automatically printed in <default> and <syntax>.
Ruslan Ermilov <ru@nginx.com>
parents: 99
diff changeset
2132 <default>off</default>
253
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
2133 <context>http</context>
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
2134 <context>server</context>
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
2135 <context>location</context>
76
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
2136
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
2137 <para>
253
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
2138 Разрешает или запрещает использование опции сокета
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
2139 <c-def>TCP_NOPUSH</c-def> во FreeBSD или
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
2140 <c-def>TCP_CORK</c-def> в Linux.
76
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
2141 Опции включаются только при использовании <link id="sendfile"/>.
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
2142 Включение опции позволяет
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
2143 <list type="bullet">
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
2144
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
2145 <listitem>
253
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
2146 передавать заголовок ответа и начало файла в одном пакете
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
2147 в Linux и во FreeBSD&nbsp;4.*;
76
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
2148 </listitem>
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
2149
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
2150 <listitem>
253
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
2151 передавать файл полными пакетами.
76
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
2152 </listitem>
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
2153
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
2154 </list>
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
2155 </para>
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
2156
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
2157 </directive>
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
2158
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
2159
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
2160 <directive name="try_files">
253
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
2161 <syntax>
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
2162 <argument>файл</argument> ...
270
945d7299c26c Spaces are now preserved here, so removed all the hacks.
Ruslan Ermilov <ru@nginx.com>
parents: 253
diff changeset
2163 <argument>uri</argument></syntax>
253
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
2164 <syntax>
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
2165 <argument>файл</argument> ...
270
945d7299c26c Spaces are now preserved here, so removed all the hacks.
Ruslan Ermilov <ru@nginx.com>
parents: 253
diff changeset
2166 =<argument>код</argument></syntax>
99
1d315ef37215 The case <default/> is now language-agnostic.
Ruslan Ermilov <ru@nginx.com>
parents: 79
diff changeset
2167 <default/>
253
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
2168 <context>server</context>
76
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
2169 <context>location</context>
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
2170
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
2171 <para>
253
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
2172 Проверяет существование файлов в заданном порядке и использует
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
2173 для обработки запроса первый найденный файл, причём обработка
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
2174 делается в контексте этого же location'а.
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
2175 Путь к файлу строится из аргумента <argument>файл</argument>
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
2176 в соответствии с директивами
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
2177 <link id="root"/> и <link id="alias"/>.
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
2178 С помощью слэша в конце имени можно проверить существование каталога,
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
2179 например, “<code>$uri/</code>”.
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
2180 В случае, если ни один файл не найден, то делается внутреннее
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
2181 перенаправление на <argument>uri</argument>, заданный последним аргументом.
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
2182 Например:
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
2183 <example>
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
2184 location /images/ {
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
2185 try_files $uri /images/default.gif;
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
2186 }
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
2187
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
2188 location = /images/default.gif {
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
2189 expires 30s;
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
2190 }
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
2191 </example>
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
2192 Последний аргумент может также указывать на именованный location,
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
2193 смотрите примеры ниже.
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
2194 С версии 0.7.51 последний аргумент может также быть кодом:
76
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
2195 <example>
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
2196 location / {
253
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
2197 try_files $uri $uri/index.html $uri.html =404;
76
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
2198 }
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
2199 </example>
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
2200 </para>
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
2201
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
2202 <para>
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
2203 Пример использования при проксировании Mongrel:
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
2204 <example>
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
2205 location / {
253
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
2206 try_files /system/maintenance.html
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
2207 $uri $uri/index.html $uri.html
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
2208 @mongrel;
76
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
2209 }
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
2210
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
2211 location @mongrel {
253
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
2212 proxy_pass http://mongrel;
76
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
2213 }
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
2214 </example>
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
2215 </para>
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
2216
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
2217 <para>
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
2218 Пример использования вместе с Drupal/FastCGI:
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
2219 <example>
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
2220 location / {
253
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
2221 try_files $uri $uri/ @drupal;
76
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
2222 }
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
2223
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
2224 location ~ \.php$ {
253
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
2225 try_files $uri @drupal;
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
2226
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
2227 fastcgi_pass ...;
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
2228
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
2229 fastcgi_param SCRIPT_FILENAME /path/to$fastcgi_script_name;
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
2230 fastcgi_param SCRIPT_NAME $fastcgi_script_name;
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
2231 fastcgi_param QUERY_STRING $args;
76
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
2232
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
2233 ... прочие fastcgi_param
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
2234 }
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
2235
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
2236 location @drupal {
253
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
2237 fastcgi_pass ...;
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
2238
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
2239 fastcgi_param SCRIPT_FILENAME /path/to/index.php;
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
2240 fastcgi_param SCRIPT_NAME /index.php;
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
2241 fastcgi_param QUERY_STRING q=$uri&amp;$args;
76
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
2242
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
2243 ... прочие fastcgi_param
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
2244 }
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
2245 </example>
253
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
2246 В следующем примере директива <code>try_files</code>
76
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
2247 <example>
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
2248 location / {
253
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
2249 try_files $uri $uri/ @drupal;
76
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
2250 }
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
2251 </example>
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
2252 аналогична директивам
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
2253 <example>
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
2254 location / {
253
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
2255 error_page 404 = @drupal;
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
2256 log_not_found off;
76
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
2257 }
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
2258 </example>
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
2259 А здесь
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
2260 <example>
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
2261 location ~ \.php$ {
253
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
2262 try_files $uri @drupal;
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
2263
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
2264 fastcgi_pass ...;
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
2265
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
2266 fastcgi_param SCRIPT_FILENAME /path/to$fastcgi_script_name;
76
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
2267
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
2268 ...
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
2269 }
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
2270 </example>
253
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
2271 <code>try_files</code> проверяет существование PHP-файла,
76
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
2272 прежде чем передать запрос FastCGI-серверу.
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
2273 </para>
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
2274
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
2275 <para>
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
2276 Пример использования вместе с Wordpress и Joomla:
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
2277 <example>
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
2278 location / {
253
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
2279 try_files $uri $uri/ @wordpress;
76
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
2280 }
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
2281
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
2282 location ~ \.php$ {
253
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
2283 try_files $uri @wordpress;
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
2284
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
2285 fastcgi_pass ...;
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
2286
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
2287 fastcgi_param SCRIPT_FILENAME /path/to$fastcgi_script_name;
76
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
2288 ... прочие fastcgi_param
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
2289 }
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
2290
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
2291 location @wordpress {
253
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
2292 fastcgi_pass ...;
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
2293
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
2294 fastcgi_param SCRIPT_FILENAME /path/to/index.php;
76
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
2295 ... прочие fastcgi_param
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
2296 }
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
2297 </example>
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
2298 </para>
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
2299
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
2300 </directive>
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
2301
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
2302
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
2303 <directive name="types">
108
72524ae53106 Explicitly marked directives with the block syntax. Such directives will
Ruslan Ermilov <ru@nginx.com>
parents: 106
diff changeset
2304 <syntax block="yes"/>
102
c76a257f3fd4 The directive name is now automatically printed in <default> and <syntax>.
Ruslan Ermilov <ru@nginx.com>
parents: 99
diff changeset
2305 <default>
c76a257f3fd4 The directive name is now automatically printed in <default> and <syntax>.
Ruslan Ermilov <ru@nginx.com>
parents: 99
diff changeset
2306 text/html html;
c76a257f3fd4 The directive name is now automatically printed in <default> and <syntax>.
Ruslan Ermilov <ru@nginx.com>
parents: 99
diff changeset
2307 image/gif gif;
c76a257f3fd4 The directive name is now automatically printed in <default> and <syntax>.
Ruslan Ermilov <ru@nginx.com>
parents: 99
diff changeset
2308 image/jpeg jpg;
c76a257f3fd4 The directive name is now automatically printed in <default> and <syntax>.
Ruslan Ermilov <ru@nginx.com>
parents: 99
diff changeset
2309 </default>
253
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
2310 <context>http</context>
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
2311 <context>server</context>
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
2312 <context>location</context>
76
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
2313
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
2314 <para>
253
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
2315 Задаёт соответствие расширений имён файлов и MIME-типов ответов.
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
2316 Расширения нечувствительны к регистру символов.
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
2317 Одному MIME-типу может соответствовать несколько расширений, например:
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
2318 <example>
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
2319 types {
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
2320 application/octet-stream bin exe dll;
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
2321 application/octet-stream deb;
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
2322 application/octet-stream dmg;
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
2323 }
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
2324 </example>
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
2325 </para>
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
2326
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
2327 <para>
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
2328 Достаточно полная таблица соответствий входит в дистрибутив nginx
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
2329 и находится в файле <path>conf/mime.types</path>.
76
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
2330 </para>
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
2331
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
2332 <para>
253
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
2333 Для того, чтобы для определённого location'а для всех ответов
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
2334 выдавался MIME-тип “<code>application/octet-stream</code>”,
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
2335 можно использовать следующее:
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
2336 <example>
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
2337 location /download/ {
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
2338 types { }
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
2339 default_type application/octet-stream;
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
2340 }
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
2341 </example>
76
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
2342 </para>
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
2343
253
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
2344 </directive>
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
2345
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
2346
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
2347 <directive name="types_hash_bucket_size">
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
2348 <syntax><argument>размер</argument></syntax>
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
2349 <default>32|64|128</default>
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
2350 <context>http</context>
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
2351 <context>server</context>
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
2352 <context>location</context>
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
2353
76
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
2354 <para>
253
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
2355 Задаёт размер корзины в хэш-таблицах типов.
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
2356 Значение по умолчанию зависит от размера строки кэша процессора.
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
2357 Подробнее смотрите в документе по
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
2358 <link doc="../hash.xml">настройке хэшей</link>.
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
2359 </para>
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
2360
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
2361 </directive>
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
2362
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
2363
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
2364 <directive name="types_hash_max_size">
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
2365 <syntax><argument>размер</argument></syntax>
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
2366 <default>1024</default>
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
2367 <context>http</context>
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
2368 <context>server</context>
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
2369 <context>location</context>
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
2370
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
2371 <para>
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
2372 Задаёт максимальный <argument>размер</argument> хэш-таблиц типов.
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
2373 Подробнее смотрите в документе по
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
2374 <link doc="../hash.xml">настройке хэшей</link>.
76
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
2375 </para>
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
2376
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
2377 </directive>
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
2378
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
2379
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
2380 <directive name="underscores_in_headers">
253
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
2381 <syntax><value>on</value> | <value>off</value></syntax>
102
c76a257f3fd4 The directive name is now automatically printed in <default> and <syntax>.
Ruslan Ermilov <ru@nginx.com>
parents: 99
diff changeset
2382 <default>off</default>
253
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
2383 <context>http</context>
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
2384 <context>server</context>
76
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
2385
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
2386 <para>
253
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
2387 Разрешает или запрещает использование символов подчёркивания в
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
2388 полях заголовка запроса клиента.
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
2389 Если запрещено, поля заголовка запроса, в чьих именах есть подчёркивания,
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
2390 помечаются как недопустимые и подпадают под действие директивы
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
2391 <link id="ignore_invalid_headers"/>.
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
2392 </para>
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
2393
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
2394 </directive>
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
2395
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
2396
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
2397 <directive name="variables_hash_bucket_size">
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
2398 <syntax><argument>размер</argument></syntax>
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
2399 <default>64</default>
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
2400 <context>http</context>
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
2401
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
2402 <para>
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
2403 Задаёт размер корзины в хэш-таблице переменных.
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
2404 Подробнее смотрите в документе по
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
2405 <link doc="../hash.xml">настройке хэшей</link>.
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
2406 </para>
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
2407
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
2408 </directive>
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
2409
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
2410
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
2411 <directive name="variables_hash_max_size">
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
2412 <syntax><argument>размер</argument></syntax>
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
2413 <default>512</default>
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
2414 <context>http</context>
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
2415
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
2416 <para>
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
2417 Задаёт максимальный <argument>размер</argument> хэш-таблицы переменных.
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
2418 Подробнее смотрите в документе по
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
2419 <link doc="../hash.xml">настройке хэшей</link>.
76
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
2420 </para>
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
2421
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
2422 </directive>
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
2423
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
2424 </section>
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
2425
253
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
2426 <section id="variables" name="Встроенные переменные">
76
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
2427
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
2428 <para>
253
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
2429 Модуль <code>ngx_http_core_module</code> поддерживает встроенные переменные,
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
2430 имена которых совпадают с именами переменных веб-сервера Apache.
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
2431 Прежде всего, это переменные, представляющие из себя поля заголовка
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
2432 запроса клиента, такие как <var>$http_user_agent</var>, <var>$http_cookie</var>
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
2433 и тому подобное.
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
2434 Кроме того, есть и другие переменные:
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
2435 <list type="tag">
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
2436
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
2437 <tag-name><var>$arg_</var><argument>имя</argument></tag-name>
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
2438 <tag-desc>
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
2439 аргумент <argument>имя</argument> в строке запроса
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
2440 </tag-desc>
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
2441
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
2442 <tag-name><var>$args</var></tag-name>
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
2443 <tag-desc>
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
2444 аргументы в строке запроса
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
2445 </tag-desc>
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
2446
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
2447 <tag-name><var>$binary_remote_addr</var></tag-name>
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
2448 <tag-desc>
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
2449 адрес клиента в бинарном виде, длина значения всегда 4 байта
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
2450 </tag-desc>
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
2451
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
2452 <tag-name><var>$body_bytes_sent</var></tag-name>
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
2453 <tag-desc>
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
2454 число байт, переданное клиенту, без учёта заголовка ответа
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
2455 </tag-desc>
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
2456
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
2457 <tag-name><var>$content_length</var></tag-name>
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
2458 <tag-desc>
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
2459 поле <header>Content-Length</header> заголовка запроса
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
2460 </tag-desc>
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
2461
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
2462 <tag-name><var>$content_type</var></tag-name>
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
2463 <tag-desc>
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
2464 поле <header>Content-Type</header> заголовка запроса
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
2465 </tag-desc>
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
2466
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
2467 <tag-name><var>$cookie_</var><argument>имя</argument></tag-name>
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
2468 <tag-desc>
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
2469 cookie <argument>имя</argument>
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
2470 </tag-desc>
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
2471
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
2472 <tag-name><var>$document_root</var></tag-name>
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
2473 <tag-desc>
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
2474 значение директивы <link id="root"/> для текущего запроса
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
2475 </tag-desc>
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
2476
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
2477 <tag-name><var>$document_uri</var></tag-name>
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
2478 <tag-desc>
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
2479 то же, что и <var>$uri</var>
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
2480 </tag-desc>
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
2481
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
2482 <tag-name><var>$host</var></tag-name>
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
2483 <tag-desc>
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
2484 поле <header>Host</header> заголовка запроса,
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
2485 или имя сервера, соответствующего запросу, если этого поля нет
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
2486 </tag-desc>
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
2487
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
2488 <tag-name><var>$hostname</var></tag-name>
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
2489 <tag-desc>
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
2490 имя хоста
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
2491 </tag-desc>
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
2492
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
2493 <tag-name><var>$http_</var><argument>имя</argument></tag-name>
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
2494 <tag-desc>
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
2495 поле <argument>имя</argument> заголовка запроса
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
2496 </tag-desc>
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
2497
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
2498 <tag-name><var>$https</var></tag-name>
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
2499 <tag-desc>
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
2500 “<code>on</code>”
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
2501 если соединение работает в режиме SSL,
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
2502 либо пустая строка
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
2503 </tag-desc>
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
2504
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
2505 <tag-name><var>$is_args</var></tag-name>
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
2506 <tag-desc>
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
2507 “<code>?</code>”, если в строке запроса есть аргументы,
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
2508 и пустая строка, если их нет
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
2509 </tag-desc>
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
2510
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
2511 <tag-name><var>$limit_rate</var></tag-name>
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
2512 <tag-desc>
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
2513 позволяет ограничивать скорость соединения
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
2514 </tag-desc>
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
2515
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
2516 <tag-name><var>$nginx_version</var></tag-name>
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
2517 <tag-desc>
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
2518 версия nginx
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
2519 </tag-desc>
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
2520
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
2521 <tag-name><var>$pid</var></tag-name>
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
2522 <tag-desc>
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
2523 номер (PID) рабочего процесса
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
2524 </tag-desc>
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
2525
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
2526 <tag-name><var>$query_string</var></tag-name>
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
2527 <tag-desc>
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
2528 то же, что и <var>$args</var>
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
2529 </tag-desc>
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
2530
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
2531 <tag-name><var>$realpath_root</var></tag-name>
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
2532 <tag-desc>
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
2533 значение директивы <link id="root"/> для текущего запроса,
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
2534 при этом все символические ссылки преобразованы в реальные путь
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
2535 </tag-desc>
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
2536
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
2537 <tag-name><var>$remote_addr</var></tag-name>
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
2538 <tag-desc>
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
2539 адрес клиента
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
2540 </tag-desc>
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
2541
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
2542 <tag-name><var>$remote_port</var></tag-name>
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
2543 <tag-desc>
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
2544 порт клиента
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
2545 </tag-desc>
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
2546
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
2547 <tag-name><var>$remote_user</var></tag-name>
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
2548 <tag-desc>
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
2549 имя пользователя, использованное в Basic аутентификации
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
2550 </tag-desc>
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
2551
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
2552 <tag-name><var>$request</var></tag-name>
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
2553 <tag-desc>
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
2554 оригинальная строка запроса целиком
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
2555 </tag-desc>
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
2556
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
2557 <tag-name><var>$request_body</var></tag-name>
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
2558 <tag-desc>
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
2559 тело запроса
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
2560 <para>
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
2561 Значение переменной появляется в location'ах, обрабатываемых
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
2562 директивами
106
56457a474903 If text of the link is not provided, the @id is used.
Ruslan Ermilov <ru@nginx.com>
parents: 102
diff changeset
2563 <link doc="ngx_http_proxy_module.xml" id="proxy_pass"/>
253
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
2564 и
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
2565 <link doc="ngx_http_fastcgi_module.xml" id="fastcgi_pass"/>.
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
2566 </para>
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
2567 </tag-desc>
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
2568
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
2569 <tag-name><var>$request_body_file</var></tag-name>
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
2570 <tag-desc>
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
2571 имя временного файла, в котором хранится тело запроса
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
2572 <para>
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
2573 По завершению обработки файл необходимо удалить.
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
2574 Для того, чтобы тело запроса всегда записывалось в файл,
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
2575 следует указать
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
2576 <link id="client_body_in_file_only">client_body_in_file_only on</link>.
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
2577 При передаче имени временного файла в проксированном запросе
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
2578 или в запросе к FastCGI-серверу следует запретить передачу самого
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
2579 тела директивами
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
2580 <link doc="ngx_http_proxy_module.xml" id="proxy_pass_request_body">
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
2581 proxy_pass_request_body off</link>
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
2582 или
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
2583 <link doc="ngx_http_fastcgi_module.xml" id="fastcgi_pass_request_body">
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
2584 fastcgi_pass_request_body off</link>
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
2585 соответственно.
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
2586 </para>
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
2587 </tag-desc>
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
2588
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
2589 <tag-name><var>$request_completion</var></tag-name>
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
2590 <tag-desc>
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
2591 “<code>OK</code>” если запрос завершился,
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
2592 либо пустая строка
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
2593 </tag-desc>
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
2594
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
2595 <tag-name><var>$request_filename</var></tag-name>
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
2596 <tag-desc>
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
2597 путь к файлу для текущего запроса, формируемый из директив
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
2598 <link id="root"/> или <link id="alias"/> и URI запроса
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
2599 </tag-desc>
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
2600
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
2601 <tag-name><var>$request_method</var></tag-name>
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
2602 <tag-desc>
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
2603 метод запроса, обычно
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
2604 “<code>GET</code>” или “<code>POST</code>”
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
2605 </tag-desc>
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
2606
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
2607 <tag-name><var>$request_uri</var></tag-name>
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
2608 <tag-desc>
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
2609 оригинальный URI запроса целиком (с аргументами)
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
2610 </tag-desc>
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
2611
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
2612 <tag-name><var>$scheme</var></tag-name>
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
2613 <tag-desc>
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
2614 схема запроса, “<code>http</code>” или “<code>https</code>”
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
2615 </tag-desc>
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
2616
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
2617 <tag-name><var>$sent_http_</var><argument>имя</argument></tag-name>
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
2618 <tag-desc>
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
2619 поле <argument>имя</argument> заголовка ответа
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
2620 </tag-desc>
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
2621
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
2622 <tag-name><var>$server_addr</var></tag-name>
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
2623 <tag-desc>
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
2624 адрес сервера, принявшего запрос
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
2625 <para>
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
2626 Получение значения этой переменной обычно требует одного системного вызова.
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
2627 Чтобы избежать системного вызова, в директивах <link id="listen"/>
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
2628 следует указывать адреса и использовать параметр <parameter>bind</parameter>.
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
2629 </para>
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
2630 </tag-desc>
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
2631
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
2632 <tag-name><var>$server_name</var></tag-name>
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
2633 <tag-desc>
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
2634 имя сервера, принявшего запрос
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
2635 </tag-desc>
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
2636
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
2637 <tag-name><var>$server_port</var></tag-name>
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
2638 <tag-desc>
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
2639 порт сервера, принявшего запрос
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
2640 </tag-desc>
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
2641
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
2642 <tag-name><var>$server_protocol</var></tag-name>
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
2643 <tag-desc>
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
2644 протокол сервера, обычно
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
2645 “<code>HTTP/1.0</code>”
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
2646 или
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
2647 “<code>HTTP/1.1</code>”
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
2648 </tag-desc>
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
2649
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
2650 <tag-name><var>$uri</var></tag-name>
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
2651 <tag-desc>
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
2652 текущий URI запроса
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
2653 <para>
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
2654 Он может отличаться от первоначального, например, при внутренних
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
2655 перенаправлениях или при использовании индексных файлов.
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
2656 </para>
ff1e139a8c98 Bring the ngx_http_core_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
2657 </tag-desc>
76
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
2658
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
2659 </list>
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
2660 </para>
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
2661
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
2662 </section>
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
2663
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
2664 </module>