annotate docs/xml/http/ngx_http_core_module.xml @ 4069:4dbdfd985863

Regenerate HTML for the previous revision.
author Ruslan Ermilov <ru@nginx.com>
date Mon, 05 Sep 2011 09:40:50 +0000
parents 22364b1f61c9
children d0d832a3b1df
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
4068
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1 <?xml version="1.0"?>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
2
3996
fc808f006ff4 skeleton for documentation processing
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
3 <!DOCTYPE module SYSTEM "../../dtd/module.dtd">
fc808f006ff4 skeleton for documentation processing
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
4
4068
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
5 <module name="HTTP Core Module" id="http_core_module">
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
6
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
7 <section id="directives" name="Directives">
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
8
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
9 <directive name="aio" appeared-in="0.8.11">
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
10 <syntax>aio
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
11 <value>on</value> |
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
12 <value>off</value> |
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
13 <value>sendfile</value>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
14 </syntax>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
15 <default>aio off</default>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
16 <context>http</context>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
17 <context>server</context>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
18 <context>location</context>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
19
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
20 <para>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
21 Enables or disables the use of asynchronous file I/O (AIO)
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
22 on FreeBSD and Linux.
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
23 </para>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
24
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
25 <para>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
26 On FreeBSD, AIO is usable used starting from FreeBSD 4.3.
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
27 AIO can either be linked statically into a kernel:
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
28 <example>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
29 options VFS_AIO
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
30 </example>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
31 or loaded dynamically as a kernel loadable module:
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
32 <example>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
33 kldload aio
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
34 </example>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
35 </para>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
36
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
37 <para>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
38 In FreeBSD versions 5 and 6, enabling AIO statically, or dynamically
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
39 when booting the kernel, will cause the entire networking subsystem
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
40 to use the Giant lock that can impact overall performance negatively.
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
41 This limitation has been removed in FreeBSD 6.4-STABLE in 2009, and in
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
42 FreeBSD 7.
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
43 However, starting from FreeBSD 5.3, it's possible to enable AIO
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
44 without the penalty of running the networking subsystem under a
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
45 Giant lock&mdash;for this to work, the AIO module needs to be loaded
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
46 after the kernel has booted.
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
47 In this case, the following message will appear in
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
48 <code>/var/log/messages</code>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
49 <example>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
50 WARNING: Network stack Giant-free, but aio requires Giant.
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
51 Consider adding 'options NET_WITH_GIANT' or setting debug.mpsafenet=0
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
52 </example>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
53 and can safely be ignored.
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
54 <note>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
55 The requirement to use the Giant lock with AIO is related to the
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
56 fact that FreeBSD supports asynchronous calls
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
57 <c-func>aio_read</c-func>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
58 and
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
59 <c-func>aio_write</c-func>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
60 when working with sockets.
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
61 However, since nginx only uses AIO for disk I/O, no problems should arise.
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
62 </note>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
63 </para>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
64
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
65 <para>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
66 For AIO to work,
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
67 <link id="sendfile">sendfile</link>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
68 needs to be disabled:
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
69 <example>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
70 location /video/ {
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
71 sendfile off;
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
72 aio on;
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
73 output_buffers 1 64k;
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
74 }
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
75 </example>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
76 </para>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
77
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
78 <para>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
79 In addition, starting from FreeBSD 5.2.1 and nginx 0.8.12, AIO can
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
80 also be used to pre-load data for <c-func>sendfile</c-func>:
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
81 <example>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
82 location /video/ {
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
83 sendfile on;
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
84 tcp_nopush on;
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
85 aio sendfile;
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
86 }
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
87 </example>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
88 In this configuration, <c-func>sendfile</c-func> is called with
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
89 the <c-def>SF_NODISKIO</c-def> flag which causes it not to
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
90 block on disk I/O and instead report back when the data are not in
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
91 memory; nginx then initiates an asynchronous data load by reading
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
92 one byte. The FreeBSD kernel then loads the first 128K bytes
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
93 of a file into memory, however next reads will only load data
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
94 in 16K chunks. This can be tuned using the
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
95 <link id="read_ahead">read_ahead</link>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
96 directive.
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
97 </para>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
98
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
99 <para>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
100 On Linux, AIO is usable starting from kernel version 2.6.22;
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
101 plus, it is also necessary to enable
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
102 <link id="directio">directio</link>,
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
103 otherwise reading will be blocking:
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
104 <example>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
105 location /video/ {
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
106 aio on;
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
107 directio 512;
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
108 output_buffers 1 128k;
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
109 }
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
110 </example>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
111 </para>
3996
fc808f006ff4 skeleton for documentation processing
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
112
4068
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
113 <para>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
114 On Linux,
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
115 <link id="directio">directio</link>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
116 can only be used for reading blocks that are aligned on 512-byte
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
117 boundaries (or 4K for XFS).
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
118 Reading of unaligned file's tail is still made in blocking mode.
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
119 The same holds true for byte range requests, and for FLV requests
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
120 not from the beginning of a file: reading of unaligned data at the
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
121 beginning and end of a file will be blocking.
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
122 There is no need to turn off
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
123 <link id="sendfile">sendfile</link>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
124 explicitly as it is turned off automatically when
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
125 <link id="directio">directio</link>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
126 is used.
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
127 </para>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
128
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
129 </directive>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
130
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
131
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
132 <directive name="alias">
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
133 <syntax>alias <argument>path</argument></syntax>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
134 <default/>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
135 <context>location</context>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
136
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
137 <para>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
138 Defines a replacement for the specified location.
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
139 For example, with the following configuration
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
140 <example>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
141 location /i/ {
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
142 alias /data/w3/images/;
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
143 }
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
144 </example>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
145 the request of "/i/top.gif" will be responded
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
146 with the file "/data/w3/images/top.gif".
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
147 </para>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
148
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
149 <para>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
150 The <argument>path</argument> value can contain variables.
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
151 </para>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
152
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
153 <para>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
154 If <command>alias</command> is used inside a location defined
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
155 with a regular expression then such regular expression should
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
156 contain captures and <command>alias</command> should refer to
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
157 these captures (0.7.40), for example:
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
158 <example>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
159 location ~ ^/users/(.+\.(?:gif|jpe?g|png))$ {
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
160 alias /data/w3/images/$1;
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
161 }
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
162 </example>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
163 </para>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
164
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
165 <para>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
166 When location matches the last part of the directive's value:
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
167 <example>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
168 location /images/ {
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
169 alias /data/w3/images/;
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
170 }
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
171 </example>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
172 it's better to use the
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
173 <link id="root">root</link>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
174 directive instead:
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
175 <example>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
176 location /images/ {
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
177 root /data/w3;
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
178 }
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
179 </example>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
180 </para>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
181
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
182 </directive>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
183
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
184
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
185 <directive name="client_body_in_file_only">
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
186 <syntax>client_body_in_file_only
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
187 <value>on</value> |
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
188 <value>clean</value> |
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
189 <value>off</value>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
190 </syntax>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
191 <default>client_body_in_file_only off</default>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
192 <context>http</context>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
193 <context>server</context>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
194 <context>location</context>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
195
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
196 <para>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
197 Determines whether nginx should save the entire client request body
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
198 into a file.
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
199 This directive can be used during debugging, or when using the
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
200 <var>$request_body_file</var>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
201 variable, or the
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
202 <link doc="ngx_http_perl_module.xml" id="methods">$r->request_body_file</link>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
203 method of the
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
204 <link doc="ngx_http_perl_module.xml">http_perl</link> module.
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
205 </para>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
206
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
207 <para>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
208 When set to the value <code>on</code>, temporary files are not
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
209 removed after request processing.
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
210 </para>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
211
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
212 <para>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
213 The value <code>clean</code> will cause the temporary files
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
214 left after request processing to be removed.
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
215 </para>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
216
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
217 </directive>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
218
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
219
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
220 <directive name="client_body_in_single_buffer">
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
221 <syntax>client_body_in_single_buffer <value>on</value> | <value>off</value>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
222 </syntax>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
223 <default>client_body_in_single_buffer off</default>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
224 <context>http</context>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
225 <context>server</context>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
226 <context>location</context>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
227
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
228 <para>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
229 Determines whether nginx should save the entire client request body
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
230 in a single buffer.
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
231 The directive is recommended when using the
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
232 <var>$request_body</var>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
233 variable, to save the number of copy operations involved.
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
234 </para>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
235
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
236 </directive>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
237
3996
fc808f006ff4 skeleton for documentation processing
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
238
fc808f006ff4 skeleton for documentation processing
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
239 <directive name="client_body_buffer_size">
fc808f006ff4 skeleton for documentation processing
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
240
4068
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
241 <syntax>client_body_buffer_size <argument>size</argument></syntax>
3996
fc808f006ff4 skeleton for documentation processing
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
242 <default>client_body_buffer_size 8k/16k</default>
4068
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
243 <context>http</context>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
244 <context>server</context>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
245 <context>location</context>
3996
fc808f006ff4 skeleton for documentation processing
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
246
fc808f006ff4 skeleton for documentation processing
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
247 <para>
4068
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
248 Sets buffer size for reading client request body.
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
249 In case request body is larger than the buffer,
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
250 the whole body or only its part is written to a temporary file.
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
251 <!-- ссылку на соотв. директивы про временные файлы? -->
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
252 By default, buffer size is equal to two memory pages.
3996
fc808f006ff4 skeleton for documentation processing
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
253 This is 8K on x86, other 32-bit platforms, and x86-64.
fc808f006ff4 skeleton for documentation processing
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
254 It is usually 16K on other 64-bit platforms.
fc808f006ff4 skeleton for documentation processing
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
255 </para>
fc808f006ff4 skeleton for documentation processing
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
256
fc808f006ff4 skeleton for documentation processing
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
257 </directive>
fc808f006ff4 skeleton for documentation processing
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
258
fc808f006ff4 skeleton for documentation processing
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
259
4068
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
260 <directive name="client_body_temp_path">
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
261 <syntax>client_body_temp_path
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
262 <argument>path</argument>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
263 [<argument>level1</argument>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
264 [<argument>level2</argument>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
265 [<argument>level3</argument>]]]
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
266 </syntax>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
267 <default>client_body_temp_path client_body_temp</default>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
268 <context>http</context>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
269 <context>server</context>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
270 <context>location</context>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
271
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
272 <para>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
273 Defines a directory for storing temporary files holding client request bodies.
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
274 Up to three-level subdirectory hierarchy can be used underneath the specified
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
275 directory.
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
276 For example, in the following configuration
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
277 <example>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
278 client_body_temp_path /spool/nginx/client_temp 1 2;
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
279 </example>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
280 a temporary file might look like this:
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
281 <example>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
282 /spool/nginx/client_temp/7/45/00000123457
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
283 </example>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
284 </para>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
285
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
286 </directive>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
287
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
288
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
289 <directive name="client_body_timeout">
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
290 <syntax>client_body_timeout <argument>time</argument></syntax>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
291 <default>client_body_timeout 60</default>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
292 <context>http</context>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
293 <context>server</context>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
294 <context>location</context>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
295
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
296 <para>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
297 Defines a timeout for reading client request body.
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
298 A timeout is only set between two successive read operations,
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
299 not for the transmission of the whole request body.
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
300 If a client does not transmit anything within this time,
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
301 the error
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
302 <http-error code="408" text="Request time out"/>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
303 is returned.
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
304 </para>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
305
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
306 </directive>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
307
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
308
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
309 <directive name="client_header_buffer_size">
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
310 <syntax>client_header_buffer_size <argument>size</argument></syntax>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
311 <default>client_header_buffer_size 1k</default>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
312 <context>http</context>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
313 <context>server</context>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
314
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
315 <para>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
316 Sets buffer size for reading client request header.
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
317 For most requests, a buffer of 1K bytes is enough.
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
318 However, if a request includes long cookies, or comes from a WAP client,
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
319 it may not fit into 1K.
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
320 If a request line, or a request header line do not fit entirely into
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
321 this buffer then larger buffers are allocated, configured by the
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
322 <link id="large_client_header_buffers">large_client_header_buffers</link>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
323 directive.
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
324 </para>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
325
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
326 </directive>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
327
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
328
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
329 <directive name="client_header_timeout">
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
330 <syntax>client_header_timeout <argument>time</argument></syntax>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
331 <default>client_header_timeout 60</default>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
332 <context>http</context>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
333 <context>server</context>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
334
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
335 <para>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
336 Defines a timeout for reading client request header.
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
337 If a client does not transmit the entire header within this time,
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
338 the error
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
339 <http-error code="408" text="Request time out"/>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
340 is returned.
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
341 </para>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
342
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
343 </directive>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
344
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
345
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
346 <directive name="client_max_body_size">
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
347 <syntax>client_max_body_size <argument>size</argument></syntax>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
348 <default>client_max_body_size 1m</default>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
349 <context>http</context>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
350 <context>server</context>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
351 <context>location</context>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
352
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
353 <para>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
354 Sets the maximum allowed size of the client request body,
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
355 specified in the
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
356 <header>Content-Length</header>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
357 request header line.
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
358 If <argument>size</argument> is greater than the configured value, the
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
359 <http-error code="413" text="Request Entity Too Large"/>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
360 error is returned to a client.
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
361 Please be aware that
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
362 <link doc="/web/upload.xml">browsers cannot correctly display
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
363 this error</link>.
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
364 </para>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
365
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
366 </directive>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
367
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
368
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
369 <directive name="default_type">
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
370 <syntax>default_type <argument>mime-type</argument></syntax>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
371 <default>default_type text/plain</default>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
372 <context>http</context>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
373 <context>server</context>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
374 <context>location</context>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
375
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
376 <para>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
377 Defines a default MIME-type of a response.
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
378 </para>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
379
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
380 </directive>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
381
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
382
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
383 <directive name="directio" appeared-in="0.7.7">
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
384 <syntax>directio <argument>size</argument> | <value>off</value></syntax>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
385 <default>directio off</default>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
386 <context>http</context>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
387 <context>server</context>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
388 <context>location</context>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
389
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
390 <para>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
391 Enables the use of
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
392 the <c-def>O_DIRECT</c-def> flag (FreeBSD, Linux),
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
393 the <c-def>F_NOCACHE</c-def> flag (Mac OS X),
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
394 or the <c-func>directio</c-func> function (Solaris),
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
395 when reading files that are larger than the specified <argument>size</argument>.
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
396 It automatically disables (0.7.15) the use of
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
397 <link id="sendfile">sendfile</link>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
398 for a given request.
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
399 It could be useful for serving large files:
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
400 <example>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
401 directio 4m;
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
402 </example>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
403 or when using <link id="aio">aio</link> on Linux.
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
404 </para>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
405
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
406 </directive>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
407
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
408
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
409 <directive name="directio_alignment" appeared-in="0.8.11">
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
410 <syntax>directio_alignment <argument>size</argument></syntax>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
411 <default>directio_alignment 512</default>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
412 <context>http</context>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
413 <context>server</context>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
414 <context>location</context>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
415
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
416 <para>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
417 Sets an alignment for
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
418 <link id="directio">directio</link>.
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
419 In most cases, a 512-byte alignment is enough, however, when
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
420 using XFS under Linux, it needs to be increased to 4K.
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
421 </para>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
422
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
423 </directive>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
424
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
425
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
426 <directive name="error_page">
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
427 <syntax>error_page
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
428 <argument>code ...</argument>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
429 [<value>=</value>[<argument>response</argument>]]
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
430 <argument>uri</argument>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
431 </syntax>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
432 <default/>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
433 <context>http</context>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
434 <context>server</context>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
435 <context>location</context>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
436 <context>if in location</context>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
437
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
438 <para>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
439 Defines the URI that will be shown for the specified errors.
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
440 These directives are inherited from the previous level if and
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
441 only if there are no <code>error_page</code> directives on
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
442 the current level.
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
443 A URI value can contain variables.
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
444 </para>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
445
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
446 <para>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
447 Example usage:
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
448 <example>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
449 error_page 404 /404.html;
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
450 error_page 502 503 504 /50x.html;
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
451 error_page 403 http://example.com/forbidden.html;
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
452 </example>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
453 </para>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
454
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
455 <para>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
456 Furthermore, it is possible to change the response code to another, for example:
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
457 <example>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
458 error_page 404 =200 /empty.gif;
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
459 </example>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
460 </para>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
461
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
462 <para>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
463 If an error response is processed by a proxied server, or a FastCGI-server,
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
464 and the server may return different response codes (e.g., 200, 302, 401
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
465 or 404), it is possible to respond with a returned code:
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
466 <example>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
467 error_page 404 = /404.php;
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
468 </example>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
469 </para>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
470
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
471 <para>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
472 If there is no need to change URI during redirection it is possible to redirect
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
473 error processing into a named location:
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
474 <example>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
475 location / {
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
476 error_page 404 = @fallback;
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
477 }
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
478
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
479 location @fallback {
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
480 proxy_pass http://backend;
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
481 }
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
482 </example>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
483 </para>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
484
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
485 </directive>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
486
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
487
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
488 <directive name="if_modified_since" appeared-in="0.7.24">
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
489 <syntax>if_modified_since
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
490 <value>off</value> |
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
491 <value>exact</value> |
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
492 <value>before</value>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
493 </syntax>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
494 <default>if_modified_since exact</default>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
495 <context>http</context>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
496 <context>server</context>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
497 <context>location</context>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
498
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
499 <para>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
500 Specifies how to compare modification time of a response
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
501 with the time in the
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
502 <header>If-Modified-Since</header>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
503 request header:
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
504
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
505 <list type="bullet">
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
506
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
507 <listitem>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
508 <value>off</value>&mdash;the
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
509 <header>If-Modified-Since</header> request header is ignored (0.7.34);
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
510 </listitem>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
511
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
512 <listitem>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
513 <value>exact</value>&mdash;exact match;
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
514 </listitem>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
515
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
516 <listitem>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
517 <value>before</value>&mdash;modification time of a response is
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
518 less than or equal to the time in the <header>If-Modified-Since</header>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
519 request header.
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
520 </listitem>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
521
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
522 </list>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
523 </para>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
524
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
525 </directive>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
526
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
527
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
528 <directive name="internal">
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
529 <syntax>internal</syntax>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
530 <default/>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
531 <context>location</context>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
532
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
533 <para>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
534 Specifies that a given location can only be used for internal requests.
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
535 For external requests, the <http-error code="404" text="Not found"/>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
536 error is returned.
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
537 Internal requests are the following:
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
538
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
539 <list type="bullet">
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
540
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
541 <listitem>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
542 requests redirected by the <link id="error_page">error_page</link> directive;
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
543 </listitem>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
544
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
545 <listitem>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
546 subrequests formed by the
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
547 <command>include virtual</command>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
548 command of the
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
549 <link doc="ngx_http_ssi_module.xml">http_ssi</link> module;
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
550 </listitem>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
551
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
552 <listitem>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
553 requests changed by the
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
554 <link doc="ngx_http_rewrite_module.xml" id="rewrite">rewrite</link>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
555 directive of the
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
556 <link doc="ngx_http_rewrite_module.xml">http_rewrite</link> module.
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
557 </listitem>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
558
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
559 </list>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
560 </para>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
561
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
562 <para>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
563 Example usage:
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
564 <example>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
565 error_page 404 /404.html;
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
566
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
567 location /404.html {
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
568 internal;
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
569 }
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
570 </example>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
571 </para>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
572
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
573 </directive>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
574
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
575
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
576 <directive name="keepalive_requests" appeared-in="0.8.0">
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
577 <syntax>keepalive_requests <argument>number</argument></syntax>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
578 <default>keepalive_requests 100</default>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
579 <context>http</context>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
580 <context>server</context>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
581 <context>location</context>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
582
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
583 <para>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
584 Sets the maximum number of requests that can be
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
585 made through one keep-alive connection.
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
586 </para>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
587
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
588 </directive>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
589
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
590
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
591 <directive name="keepalive_timeout">
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
592 <syntax>keepalive_timeout
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
593 <argument>time</argument>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
594 [<argument>time</argument>]
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
595 </syntax>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
596 <default>keepalive_timeout 75</default>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
597 <context>http</context>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
598 <context>server</context>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
599 <context>location</context>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
600
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
601 <para>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
602 The first argument sets a timeout during which a keep-alive
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
603 client connection will stay open on the server side.
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
604 The optional second argument sets a value in the
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
605 "<header>Keep-Alive: timeout=</header><argument>time</argument>"
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
606 response header.
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
607 Two arguments may differ.
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
608 </para>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
609
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
610 <para>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
611 The
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
612 "<header>Keep-Alive: timeout=</header>"
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
613 is understood by Mozilla and Konqueror.
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
614 MSIE will close keep-alive connection in about 60 seconds.
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
615 </para>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
616
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
617 </directive>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
618
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
619
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
620 <directive name="large_client_header_buffers">
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
621 <syntax>large_client_header_buffers <argument>number size</argument></syntax>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
622 <default>large_client_header_buffers 4 4k/8k</default>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
623 <context>http</context>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
624 <context>server</context>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
625
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
626 <para>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
627 Sets the maximum <argument>number</argument> and <argument>size</argument> of
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
628 buffers used when reading large client request headers.
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
629 A request line cannot exceed the size of one buffer, or the
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
630 <http-error code="414" text="Request URI too large"/>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
631 error is returned.
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
632 A request header line cannot exceed the size of one buffer as well, or the
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
633 <http-error code="400" text="Bad request"/>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
634 error is returned.
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
635 Buffers are allocated only on demand.
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
636 By default, the buffer size is equal to one memory page size.
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
637 It is either 4K or 8K, platform dependent.
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
638 If after the end of request processing a connection is transitioned
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
639 into the keep-alive state, these buffers are freed.
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
640 </para>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
641
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
642 </directive>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
643
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
644
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
645 <directive name="limit_except">
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
646 <syntax>limit_except <argument>method</argument> ... { ... }</syntax>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
647 <default/>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
648 <context>location</context>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
649
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
650 <para>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
651 Limits allowed HTTP methods inside a location.
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
652 The GET method also implies the HEAD method.
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
653 Access to other methods can be limited using the
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
654 <link doc="ngx_http_access_module.xml">http_access</link>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
655 and
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
656 <link doc="ngx_http_auth_basic_module.xml">http_auth_basic</link>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
657 modules directives:
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
658 <example>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
659 limit_except GET {
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
660 allow 192.168.1.0/32;
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
661 deny all;
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
662 }
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
663 </example>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
664 Please note that this will limit access to all methods
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
665 <emphasis>except</emphasis> GET and HEAD.
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
666 </para>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
667
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
668 </directive>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
669
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
670
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
671 <directive name="limit_rate">
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
672 <syntax>limit_rate <argument>rate</argument></syntax>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
673 <default/>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
674 <context>http</context>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
675 <context>server</context>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
676 <context>location</context>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
677 <context>if in location</context>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
678
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
679 <para>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
680 Rate limits the transmission of a response to a client.
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
681 The <argument>rate</argument> is specified in bytes per second.
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
682 <!--
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
683 The smaller the rate, the more accurate will be the limitation.
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
684 -->
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
685 The limit is per connection, so if a single client opens 2 connections,
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
686 an overall rate will be 2x more than specified.
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
687 </para>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
688
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
689 <para>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
690 This directive is not applicable if one wants to rate limit
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
691 a group of clients on the
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
692 <link id="server">server</link>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
693 level.
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
694 If that is the case, the desired limit can be specified in the
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
695 <var>$limit_rate</var>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
696 variable:
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
697 <example>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
698 server {
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
699
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
700 if ($slow) {
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
701 set $limit_rate 4k;
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
702 }
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
703
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
704 ...
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
705 }
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
706 </example>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
707 </para>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
708
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
709 </directive>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
710
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
711
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
712 <directive name="limit_rate_after" appeared-in="0.8.0">
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
713 <syntax>limit_rate_after <argument>size</argument></syntax>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
714 <default/>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
715 <context>http</context>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
716 <context>server</context>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
717 <context>location</context>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
718 <context>if in location</context>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
719
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
720 <para>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
721 Sets the initial amount after which the further transmission
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
722 of a response to a client will be rate limited.
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
723 </para>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
724
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
725 <para>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
726 Example:
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
727 <example>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
728 location /flv/ {
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
729 flv;
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
730 limit_rate_after 500k;
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
731 limit_rate 50k;
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
732 }
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
733 </example>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
734 </para>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
735
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
736 </directive>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
737
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
738
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
739 <directive name="listen">
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
740 <syntax>listen
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
741 <argument>address</argument>[:<argument>port</argument>]
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
742 [<parameter>default</parameter> | <parameter>default_server</parameter>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
743 [<parameter>backlog</parameter>=<argument>number</argument>]
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
744 [<parameter>rcvbuf</parameter>=<argument>size</argument>]
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
745 [<parameter>sndbuf</parameter>=<argument>size</argument>]
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
746 [<parameter>accept_filter</parameter>=<argument>filter</argument>]
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
747 [<parameter>deferred</parameter>]
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
748 [<parameter>bind</parameter>]
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
749 [<parameter>ipv6only</parameter>=<value>on</value>|<value>off</value>]
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
750 [<parameter>ssl</parameter>]]
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
751 </syntax>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
752 <syntax>listen
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
753 <argument>port</argument>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
754 [<parameter>default</parameter> | <parameter>default_server</parameter>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
755 [<parameter>backlog</parameter>=<argument>number</argument>]
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
756 [<parameter>rcvbuf</parameter>=<argument>size</argument>]
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
757 [<parameter>sndbuf</parameter>=<argument>size</argument>]
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
758 [<parameter>accept_filter</parameter>=<argument>filter</argument>]
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
759 [<parameter>deferred</parameter>]
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
760 [<parameter>bind</parameter>]
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
761 [<parameter>ipv6only</parameter>=<value>on</value>|<value>off</value>]
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
762 [<parameter>ssl</parameter>]]
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
763 </syntax>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
764 <default>listen *:80 | *:8000</default>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
765 <context>server</context>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
766
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
767 <para>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
768 Sets an <argument>address</argument> and a <argument>port</argument>, on which
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
769 the server will accept requests.
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
770 Only one of <argument>address</argument> or <argument>port</argument> can be
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
771 specified.
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
772 An <argument>address</argument> may also be a hostname, for example:
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
773 <example>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
774 listen 127.0.0.1:8000;
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
775 listen 127.0.0.1;
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
776 listen 8000;
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
777 listen *:8000;
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
778 listen localhost:8000;
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
779 </example>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
780 IPv6 addresses (0.7.36) are specified in square brackets:
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
781 <example>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
782 listen [::]:8000;
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
783 listen [fe80::1];
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
784 </example>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
785 </para>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
786
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
787 <para>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
788 If only <argument>address</argument> is given, the port 80 is used.
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
789 </para>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
790
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
791 <para>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
792 If directive is not present then either the <code>*:80</code> is used
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
793 if nginx runs with superuser privileges, or <code>*:8000</code> otherwise.
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
794 </para>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
795
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
796 <para>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
797 The <parameter>default</parameter> parameter, if present,
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
798 will cause the server to become the default server for the specified
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
799 <argument>address</argument>:<argument>port</argument> pair.
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
800 If none of the directives have the <parameter>default</parameter>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
801 parameter then the first server with the
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
802 <argument>address</argument>:<argument>port</argument> pair will be
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
803 the default server for this pair.
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
804 Starting from version 0.8.21 it is possible to use the
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
805 <parameter>default_server</parameter>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
806 parameter.
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
807 </para>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
808
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
809 <para>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
810 A <code>listen</code> directive which has the <parameter>default</parameter>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
811 parameter can have several additional parameters specific to system calls
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
812 <c-func>listen</c-func> and <c-func>bind</c-func>.
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
813 Starting from version 0.8.21, these parameters can be specified in any
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
814 <code>listen</code> directive, but only once for the given
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
815 <argument>address</argument>:<argument>port</argument> pair.
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
816 <list type="bullet">
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
817
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
818 <listitem>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
819 <parameter>backlog</parameter>=<argument>number</argument>&mdash;
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
820 sets the <parameter>backlog</parameter> parameter in the
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
821 <c-func>listen</c-func> call.
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
822 By default, <parameter>backlog</parameter> equals -1 on FreeBSD
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
823 and 511 on other platforms.
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
824 </listitem>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
825
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
826 <listitem>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
827 <parameter>rcvbuf</parameter>=<argument>size</argument>&mdash;
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
828 sets the <c-def>SO_RCVBUF</c-def> parameter for the listening socket.
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
829 </listitem>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
830
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
831 <listitem>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
832 <parameter>sndbuf</parameter>=<argument>size</argument>&mdash;
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
833 sets the <c-def>SO_SNDBUF</c-def> parameter for the listening socket.
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
834 </listitem>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
835
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
836 <listitem>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
837 <parameter>accept_filter</parameter>=<argument>filter</argument>&mdash;
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
838 sets the name of the accept filter.
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
839 This works only on FreeBSD, acceptable values are <value>dataready</value>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
840 and <value>httpready</value>.
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
841 On receiving <c-def>SIGHUP</c-def> signal, an accept filter can only be
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
842 changed in recent versions of FreeBSD, starting from 6.0, 5.4-STABLE
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
843 and 4.11-STABLE.
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
844 </listitem>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
845
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
846 <listitem>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
847 <parameter>deferred</parameter>&mdash;
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
848 instructs to use a deferred <c-func>accept</c-func> on Linux
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
849 using the <c-def>TCP_DEFER_ACCEPT</c-def> option.
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
850 </listitem>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
851
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
852 <listitem>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
853 <parameter>bind</parameter>&mdash;
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
854 specifies to make a separate <c-func>bind</c-func> call for a given
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
855 <argument>address</argument>:<argument>port</argument> pair.
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
856 This is because nginx will only <c-func>bind</c-func> to
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
857 <code>*</code>:<argument>port</argument>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
858 if there are several <code>listen</code> directives with
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
859 the same port and different addresses, and one of the
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
860 <code>listen</code> directives listens on all addresses
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
861 for the given port (<code>*</code>:<argument>port</argument>).
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
862 It should be noted that in this case a <c-func>getsockname</c-func>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
863 system call will be made to determine an address that accepted a
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
864 connection.
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
865 If parameters <parameter>backlog</parameter>, <parameter>rcvbuf</parameter>,
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
866 <parameter>sndbuf</parameter>, <parameter>accept_filter</parameter>, or
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
867 <parameter>deferred</parameter> are used then for a given
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
868 <argument>address</argument>:<argument>port</argument> pair
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
869 a separate <c-func>bind</c-func> call will always be made.
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
870 </listitem>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
871
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
872 <listitem>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
873 <parameter>ipv6only</parameter>=<value>on</value>|<value>off</value>&mdash;
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
874 this parameter (0.7.42) sets the value of the <c-def>IPV6_V6ONLY</c-def>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
875 parameter for the listening socket.
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
876 This parameter can only be set once on start.
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
877 </listitem>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
878
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
879 <listitem>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
880 <parameter>ssl</parameter>&mdash;
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
881 this parameter (0.7.14) does not relate to system calls
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
882 <c-func>listen</c-func> and <c-func>bind</c-func>, but allows to
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
883 specify that all connections accepted on this port should work in
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
884 the SSL mode.
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
885 This allows for a more compact configuration for the server operating
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
886 in both HTTP and HTTPS modes simultaneously.
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
887 <example>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
888 listen 80;
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
889 listen 443 default ssl;
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
890 </example>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
891 </listitem>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
892
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
893 </list>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
894 </para>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
895
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
896 <para>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
897 Example:
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
898 <example>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
899 listen 127.0.0.1 default accept_filter=dataready backlog=1024;
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
900 </example>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
901 </para>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
902
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
903 </directive>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
904
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
905
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
906 <directive name="location">
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
907 <syntax>location [
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
908 <value>=</value> |
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
909 <value>~</value> |
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
910 <value>~*</value> |
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
911 <value>^~</value> |
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
912 <value>@</value>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
913 ] <argument>uri</argument>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
914 { ... }</syntax>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
915 <default/>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
916 <context>server</context>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
917 <!--
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
918 <context>location</context>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
919 -->
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
920
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
921 <para>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
922 Sets a configuration based on a request URI.
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
923 A location can either be defined by a prefix string, or by a regular expression.
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
924 Regular expressions are specified by prepending them with the
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
925 "<value>~*</value>" prefix (for case-insensitive matching), or with the
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
926 "<value>~</value>" prefix (for case-sensitive matching).
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
927 To find a location matching a given request, nginx first checks
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
928 locations defined using the prefix strings (prefix locations).
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
929 Amongst them, the most specific one is searched.
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
930 Then regular expressions are checked, in the order of their appearance
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
931 in a configuration file.
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
932 A search terminates on the first match, and its corresponding
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
933 configuration is used.
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
934 If no match with a regular expression location is found then a
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
935 configuration of the most specific prefix location is used.
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
936 </para>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
937
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
938 <para>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
939 For case-insensitive operating systems such as Mac OS X and Cygwin,
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
940 the string matching ignores a case (0.7.7).
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
941 However, comparison is limited to one-byte locales.
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
942 </para>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
943
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
944 <para>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
945 Regular expressions can contain captures (0.7.40) that can later
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
946 be used in other directives.
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
947 </para>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
948
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
949 <para>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
950 If the most specific prefix location has the "<value>^~</value>" prefix
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
951 then regular expressions are not checked.
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
952 </para>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
953
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
954 <para>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
955 Also, using the "<value>=</value>" prefix it's possible to define
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
956 an exact match of URI and location.
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
957 If an exact match is found, the search terminates.
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
958 For example, if a "<code>/</code>" request happens frequently,
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
959 defining "<code>location = /</code>" will speed up the processing
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
960 of these requests, as search terminates right after the first
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
961 comparison.
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
962 </para>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
963
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
964 <para>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
965 In versions from 0.7.1 to 0.8.41, if a request matched the prefix
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
966 location without the "<value>=</value>" and "<value>^~</value>"
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
967 prefixes, the search also terminated and regular expressions were
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
968 not checked.
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
969 </para>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
970
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
971 <para>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
972 Let's illustrate the above by an example:
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
973 <example>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
974 location = / {
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
975 [ configuration A ]
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
976 }
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
977
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
978 location / {
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
979 [ configuration B ]
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
980 }
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
981
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
982 location ^~ /images/ {
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
983 [ configuration C ]
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
984 }
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
985
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
986 location ~* \.(gif|jpg|jpeg)$ {
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
987 [ configuration D ]
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
988 }
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
989 </example>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
990 The "<code>/</code>" request will match configuration A,
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
991 the "<code>/documents/document.html</code>" request&mdash;configuration B,
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
992 the "<code>/images/1.gif</code>" request&mdash;configuration C, and
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
993 the "<code>/documents/1.jpg</code>" request&mdash;configuration D.
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
994 </para>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
995
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
996 <para>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
997 The "<code>@</code>" prefix defines a named location.
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
998 Such a location isn't used for a regular request processing, but instead
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
999 used for request redirection.
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1000 </para>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1001
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1002 <!--
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1003 <migration from="Apache" directive="Location" />
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1004 -->
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1005
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1006 </directive>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1007
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1008
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1009 <directive name="log_not_found">
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1010 <syntax>log_not_found <value>on</value> | <value>off</value></syntax>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1011 <default>log_not_found on</default>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1012 <context>http</context>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1013 <context>server</context>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1014 <context>location</context>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1015
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1016 <para>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1017 Enables or disables logging of errors about not found files into the
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1018 <link doc="ngx_core_module.xml" id="error_log">error_log</link>.
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1019 </para>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1020
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1021 </directive>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1022
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1023
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1024 <directive name="log_subrequest">
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1025 <syntax>log_subrequest <value>on</value> | <value>off</value></syntax>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1026 <default>log_subrequest off</default>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1027 <context>http</context>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1028 <context>server</context>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1029 <context>location</context>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1030
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1031 <para>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1032 Enables or disables logging of subrequests into the
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1033 <link doc="ngx_http_log_module.xml" id="access_log">access_log</link>.
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1034 </para>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1035
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1036 </directive>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1037
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1038
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1039 <directive name="merge_slashes">
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1040 <syntax>merge_slashes <value>on</value> | <value>off</value></syntax>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1041 <default>merge_slashes on</default>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1042 <context>http</context>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1043 <context>server</context>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1044
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1045 <para>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1046 Enables or disables compression of two or more adjacent slashes
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1047 in a URI into a single slash.
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1048 </para>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1049
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1050 <para>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1051 Note that compression is essential for the correct prefix string
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1052 and regular expressions location matching.
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1053 Without it, the "<code>//scripts/one.php</code>" request would not match
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1054 <example>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1055 location /scripts/ {
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1056 ...
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1057 }
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1058 </example>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1059 and might be processed as a static file,
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1060 so it gets converted to "<code>/scripts/one.php</code>".
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1061 </para>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1062
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1063 <para>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1064 Turning the compression <value>off</value> can become necessary if a URI
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1065 contains base64-encoded names, since base64 uses the "/" character internally.
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1066 However, for security considerations, it's better to avoid turning off
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1067 the compression.
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1068 </para>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1069
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1070 <para>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1071 If a directive is specified on the
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1072 <link id="server">server</link>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1073 level, which is also a default server, its value will cover
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1074 all virtual servers listening on the same address and port.
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1075 </para>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1076
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1077 </directive>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1078
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1079
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1080 <directive name="msie_padding">
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1081 <syntax>msie_padding <value>on</value> | <value>off</value></syntax>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1082 <default>msie_padding on</default>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1083 <context>http</context>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1084 <context>server</context>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1085 <context>location</context>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1086
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1087 <para>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1088 Enables or disables adding of comments to responses with status
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1089 greater than 400 for MSIE clients, to pad the response size to 512 bytes.
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1090 </para>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1091
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1092 </directive>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1093
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1094
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1095 <directive name="msie_refresh">
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1096 <syntax>msie_refresh <value>on</value> | <value>off</value></syntax>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1097 <default>msie_refresh off</default>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1098 <context>http</context>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1099 <context>server</context>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1100 <context>location</context>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1101
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1102 <para>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1103 Enables or disables issuing refreshes instead of redirects, for MSIE clients.
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1104 </para>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1105
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1106 </directive>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1107
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1108
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1109 <directive name="open_file_cache">
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1110 <syntax>open_file_cache
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1111 <parameter>max</parameter>=<argument>N</argument>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1112 [<parameter>inactive</parameter>=<argument>time</argument>] |
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1113 <value>off</value>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1114 </syntax>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1115 <default>open_file_cache off</default>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1116 <context>http</context>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1117 <context>server</context>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1118 <context>location</context>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1119
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1120 <para>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1121 Configures a cache that can store:
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1122 <list type="bullet">
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1123
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1124 <listitem>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1125 open file descriptors, their sizes and modification times;
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1126 </listitem>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1127
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1128 <listitem>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1129 directory lookups;
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1130 </listitem>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1131
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1132 <listitem>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1133 file lookup errors, such as "file not found", "no read permission",
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1134 and so on.
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1135 Caching of errors should be enabled separately by the
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1136 <link id="open_file_cache_errors">open_file_cache_errors</link>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1137 directive.
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1138 </listitem>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1139
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1140 </list>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1141 </para>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1142
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1143 <para>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1144 The directive has the following parameters:
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1145 <list type="bullet">
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1146
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1147 <listitem>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1148 <parameter>max</parameter>&mdash;
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1149 sets the maximum number of elements in the cache;
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1150 on cache overflow the least recently used (LRU) elements get removed;
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1151 </listitem>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1152
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1153 <listitem>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1154 <parameter>inactive</parameter>&mdash;
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1155 defines a time, after which the element gets removed from the cache
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1156 if there were no accesses to it during this time;
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1157 by default, it is 60 seconds;
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1158 </listitem>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1159
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1160 <listitem>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1161 <value>off</value>&mdash;disables the cache.
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1162 </listitem>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1163
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1164 </list>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1165 </para>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1166
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1167 <para>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1168 Example:
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1169 <example>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1170 open_file_cache max=1000 inactive=20s;
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1171 open_file_cache_valid 30s;
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1172 open_file_cache_min_uses 2;
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1173 open_file_cache_errors on;<!-- open_file_cache_events on; -->
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1174 </example>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1175 </para>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1176
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1177 </directive>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1178
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1179
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1180 <directive name="open_file_cache_errors">
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1181 <syntax>open_file_cache_errors <value>on</value> | <value>off</value></syntax>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1182 <default>open_file_cache_errors off</default>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1183 <context>http</context>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1184 <context>server</context>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1185 <context>location</context>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1186
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1187 <para>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1188 Enables or disables caching of file lookup errors by the
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1189 <link id="open_file_cache">open_file_cache</link>.
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1190 </para>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1191
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1192 </directive>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1193
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1194
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1195 <!--
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1196
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1197 <directive name="open_file_cache_events">
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1198 <syntax>open_file_cache_events <value>on</value> | <value>off</value></syntax>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1199 <default>open_file_cache_events off</default>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1200 <context>http</context>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1201 <context>server</context>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1202 <context>location</context>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1203
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1204 <para>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1205 Enables to use kernel events to validate
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1206 <link id="open_file_cache">open_file_cache</link>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1207 elements.
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1208 This directive works with the
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1209 <link doc="../events.xml" id="kqueue">kqueue</link>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1210 method only.
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1211 Note that only NetBSD&nbsp;2.0+ and FreeBSD&nbsp;6.0+
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1212 support events for arbitrary file system types.
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1213 Other operating systems support events only for essential
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1214 file systems such as UFS or FFS.
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1215 </para>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1216
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1217 </directive>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1218
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1219 -->
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1220
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1221
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1222 <directive name="open_file_cache_min_uses">
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1223 <syntax>open_file_cache_min_uses <argument>number</argument></syntax>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1224 <default>open_file_cache_min_uses 1</default>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1225 <context>http</context>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1226 <context>server</context>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1227 <context>location</context>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1228
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1229 <para>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1230 Sets the minimum <argument>number</argument> of file accesses during
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1231 the period configured by the <parameter>inactive</parameter> parameter
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1232 of the <link id="open_file_cache">open_file_cache</link> directive,
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1233 after which a file descriptor will remain open in the cache.
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1234 </para>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1235
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1236 </directive>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1237
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1238
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1239 <directive name="open_file_cache_valid">
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1240 <syntax>open_file_cache_valid <argument>time</argument></syntax>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1241 <default>open_file_cache_valid 60</default>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1242 <context>http</context>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1243 <context>server</context>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1244 <context>location</context>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1245
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1246 <para>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1247 Sets a time after which
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1248 <link id="open_file_cache">open_file_cache</link>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1249 elements should be validated.
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1250 <!--
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1251 When <link id="open_file_cache_events">
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1252 open_file_cache_events</link> is enabled, open file descriptors
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1253 are checked only once, and then updated right after they get changed.
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1254 -->
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1255 </para>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1256
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1257 </directive>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1258
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1259
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1260 <directive name="optimize_server_names">
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1261 <syntax>optimize_server_names <value>on</value> | <value>off</value></syntax>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1262 <default>optimize_server_names on</default>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1263 <context>http</context>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1264 <context>server</context>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1265
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1266 <para>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1267 This directive is obsolete.
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1268 </para>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1269
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1270 <para>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1271 Enables or disables optimization of hostname checking in name-based
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1272 virtual servers.
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1273 In particular, the checking affects hostnames used in redirects.
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1274 If optimization is enabled, and all name-based servers listening on
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1275 the same address:port pair have identical configuration, then
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1276 names are not checked during request processing, and the first
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1277 server name is used in redirects.
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1278 In case redirects should use hostnames sent by clients,
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1279 optimization needs to be disabled.
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1280 </para>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1281
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1282 </directive>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1283
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1284
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1285 <directive name="port_in_redirect">
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1286 <syntax>port_in_redirect <value>on</value> | <value>off</value></syntax>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1287 <default>port_in_redirect on</default>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1288 <context>http</context>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1289 <context>server</context>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1290 <context>location</context>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1291
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1292 <para>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1293 Enables or disables specifying the port in redirects issued by nginx.
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1294 </para>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1295
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1296 </directive>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1297
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1298
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1299 <directive name="read_ahead">
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1300 <syntax>read_ahead <argument>size</argument></syntax>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1301 <default>read_ahead 0</default>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1302 <context>http</context>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1303 <context>server</context>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1304 <context>location</context>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1305
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1306 <para>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1307 Sets the amount of pre-reading when working with files, in the kernel.
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1308 </para>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1309
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1310 <para>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1311 On Linux, the
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1312 <code>posix_fadvise(0, 0, 0, POSIX_FADV_SEQUENTIAL)</code>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1313 system call is used, so the <argument>size</argument> argument is ignored.
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1314 </para>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1315
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1316 <para>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1317 On FreeBSD, the
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1318 <code>fcntl(O_READAHEAD,</code><argument>size</argument><code>)</code>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1319 system call is used, supported in FreeBSD 9.0-CURRENT.
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1320 FreeBSD&nbsp;7 needs to be
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1321 <link doc="http://sysoev.ru/freebsd/patch.readahead.txt">patched</link>.
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1322 </para>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1323
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1324 </directive>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1325
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1326
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1327 <directive name="recursive_error_pages">
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1328 <syntax>recursive_error_pages <value>on</value> | <value>off</value></syntax>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1329 <default>recursive_error_pages off</default>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1330 <context>http</context>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1331 <context>server</context>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1332 <context>location</context>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1333
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1334 <para>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1335 Enables or disables doing several redirects using the
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1336 <link id="error_page">error_page</link>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1337 directive.
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1338 </para>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1339
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1340 </directive>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1341
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1342
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1343 <directive name="reset_timedout_connection">
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1344 <syntax>reset_timedout_connection <value>on</value> | <value>off</value></syntax>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1345 <default>reset_timedout_connection off</default>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1346 <context>http</context>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1347 <context>server</context>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1348 <context>location</context>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1349
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1350 <para>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1351 Enables or disables resetting of timed out connections.
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1352 The reset is performed as follows: before closing a socket, the
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1353 <c-def>SO_LINGER</c-def>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1354 option is set on it with a timeout value of 0.
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1355 When the socket is closed, a client is sent TCP RST, and all memory
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1356 occupied by this socket is freed.
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1357 This avoids keeping of an already closed socket with filled buffers
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1358 for a long time, in a FIN_WAIT1 state.
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1359 </para>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1360
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1361 <para>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1362 It should be noted that timed out keep-alive connections are still
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1363 closed normally.
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1364 </para>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1365
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1366 </directive>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1367
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1368
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1369 <directive name="resolver">
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1370 <syntax>resolver <argument>address</argument></syntax>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1371 <default/>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1372 <context>http</context>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1373 <context>server</context>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1374 <context>location</context>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1375
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1376 <para>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1377 Sets the <argument>address</argument> of a name server, for example:
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1378 <example>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1379 resolver 127.0.0.1;
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1380 </example>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1381 </para>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1382
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1383 </directive>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1384
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1385
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1386 <directive name="resolver_timeout">
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1387 <syntax>resolver_timeout <argument>time</argument></syntax>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1388 <default>resolver_timeout 30s</default>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1389 <context>http</context>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1390 <context>server</context>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1391 <context>location</context>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1392
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1393 <para>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1394 Sets a timeout for name resolution, for example:
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1395 <example>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1396 resolver_timeout 5s;
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1397 </example>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1398 </para>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1399
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1400 </directive>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1401
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1402
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1403 <directive name="root">
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1404 <syntax>root <argument>path</argument></syntax>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1405 <default>root html</default>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1406 <context>http</context>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1407 <context>server</context>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1408 <context>location</context>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1409 <context>if in location</context>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1410
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1411 <para>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1412 Sets the root directory for requests.
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1413 For example, with the following configuration
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1414 <example>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1415 location /i/ {
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1416 root /data/w3;
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1417 }
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1418 </example>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1419 the request of "/i/top.gif" will be responded
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1420 with the file "/data/w3/images/top.gif".
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1421 </para>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1422
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1423 <para>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1424 The <argument>path</argument> value can contain variables.
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1425 </para>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1426
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1427 <para>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1428 A path to the file is constructed by merely adding a URI to the value
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1429 of the <command>root</command> directive.
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1430 If a URI need to be modified, the
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1431 <link id="alias">alias</link> directive should be used.
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1432 </para>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1433
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1434 </directive>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1435
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1436
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1437 <directive name="satisfy">
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1438 <syntax>satisfy <value>all</value> | <value>any</value></syntax>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1439 <default>satisfy all</default>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1440 <context>location</context>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1441
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1442 <para>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1443 Allows access if any of the
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1444 <link doc="ngx_http_access_module.xml">http_access</link>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1445 or <link doc="ngx_http_auth_basic_module.xml">http_auth_basic</link>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1446 modules grant access.
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1447 <example>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1448 location / {
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1449 satisfy any;
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1450
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1451 allow 192.168.1.0/32;
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1452 deny all;
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1453
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1454 auth_basic "closed site";
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1455 auth_basic_user_file conf/htpasswd;
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1456 }
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1457 </example>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1458 </para>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1459
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1460 </directive>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1461
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1462
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1463 <directive name="satisfy_any">
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1464 <syntax>satisfy_any <value>on</value> | <value>off</value></syntax>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1465 <default>satisfy_any off</default>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1466 <context>location</context>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1467
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1468 <para>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1469 This directive was renamed to the <link id="satisfy">satisfy</link> directive.
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1470 </para>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1471
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1472 </directive>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1473
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1474
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1475 <directive name="send_timeout">
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1476 <syntax>send_timeout <argument>time</argument></syntax>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1477 <default>send_timeout 60</default>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1478 <context>http</context>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1479 <context>server</context>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1480 <context>location</context>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1481
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1482 <para>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1483 Sets a timeout for transmitting a response to the client.
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1484 A timeout is only set between two successive write operations,
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1485 not for the transmission of the whole response.
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1486 If a client does not receive anything within this time,
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1487 a connection is closed.
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1488 </para>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1489
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1490 </directive>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1491
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1492
3996
fc808f006ff4 skeleton for documentation processing
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
1493 <directive name="sendfile">
fc808f006ff4 skeleton for documentation processing
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
1494
4068
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1495 <syntax>sendfile <value>on</value> | <value>off</value></syntax>
3996
fc808f006ff4 skeleton for documentation processing
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
1496 <default>sendfile off</default>
4068
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1497 <context>http</context>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1498 <context>server</context>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1499 <context>location</context>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1500
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1501 <para>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1502 Enables or disables the use of
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1503 <c-func>sendfile</c-func>.
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1504 </para>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1505
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1506 </directive>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1507
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1508
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1509 <directive name="server">
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1510 <syntax>server { ... }</syntax>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1511 <default/>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1512 <context>http</context>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1513
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1514 <para>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1515 Sets a configuration for the virtual server.
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1516 There is no clean separation between IP-based (based on the IP address)
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1517 and name-based (based on the <header>Host</header> header string)
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1518 virtual servers.
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1519 Instead, the <link id="listen">listen</link> directives describe all
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1520 addresses and ports that should accept connections for a server, and the
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1521 <link id="server_name">server_name</link> directive lists all server names.
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1522 An example configuration is provided in the
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1523 <link doc="/docs/virtual_hosts.xml">
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1524 Setting Up Virtual Servers</link> document.
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1525 </para>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1526
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1527 </directive>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1528
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1529
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1530 <directive name="server_name">
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1531 <syntax>server_name <argument>name ...</argument></syntax>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1532 <default>server_name hostname</default>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1533 <context>server</context>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1534
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1535 <para>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1536 Sets names of the virtual server, for example:
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1537 <example>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1538 server {
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1539 server_name example.com www.example.com;
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1540 }
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1541 </example>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1542 </para>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1543
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1544 <para>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1545 The first name becomes a primary server name.
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1546 By default, the machine's hostname is used.
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1547 Server names can include an asterisk ("<code>*</code>")
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1548 to replace the first or last part of a name:
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1549 <example>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1550 server {
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1551 server_name example.com *.example.com www.example.*;
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1552 }
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1553 </example>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1554 </para>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1555
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1556 <para>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1557 The first two of the above mentioned names can be combined:
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1558 <example>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1559 server {
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1560 server_name .example.com;
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1561 }
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1562 </example>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1563 </para>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1564
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1565 <para>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1566 It is also possible to use regular expressions in server names,
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1567 prepending the name with a tilde ("<code>~</code>"):
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1568 <example>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1569 server {
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1570 server_name www.example.com ~^www\d+\.example\.com$;
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1571 }
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1572 </example>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1573 </para>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1574
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1575 <para>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1576 Regular expressions can contain captures (0.7.40) that can later
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1577 be used in other directives:
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1578 <example>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1579 server {
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1580 server_name ~^(www\.)?(.+)$;
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1581
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1582 location / {
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1583 root /sites/$2;
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1584 }
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1585 }
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1586
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1587 server {
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1588 server_name _;
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1589
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1590 location / {
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1591 root /sites/default;
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1592 }
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1593 }
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1594 </example>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1595 </para>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1596
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1597 <para>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1598 Starting from version 0.8.25, named captures in regular expressions create
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1599 variables that can later be used in other directives:
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1600 <example>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1601 server {
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1602 server_name ~^(www\.)?(?&lt;domain&gt;.+)$;
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1603
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1604 location / {
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1605 root /sites/$domain;
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1606 }
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1607 }
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1608
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1609 server {
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1610 server_name _;
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1611
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1612 location / {
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1613 root /sites/default;
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1614 }
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1615 }
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1616 </example>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1617 </para>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1618
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1619 <para>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1620 Starting from version 0.7.11, it is possible to specify an empty name "":
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1621 <example>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1622 server {
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1623 server_name www.example.com "";
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1624 }
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1625 </example>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1626 It allows this server to process requests without the <header>Host</header>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1627 header, instead of the default server for the given address:port pair.
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1628 </para>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1629
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1630 <para>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1631 The name checking order is as follows:
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1632 <list type="enum">
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1633
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1634 <listitem>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1635 full names
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1636 </listitem>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1637
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1638 <listitem>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1639 names with the prefix mask&mdash;*.example.com
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1640 </listitem>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1641
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1642 <listitem>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1643 names with the suffix mask&mdash;mail.*
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1644 </listitem>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1645
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1646 <listitem>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1647 regular expressions
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1648 </listitem>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1649
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1650 </list>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1651 </para>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1652
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1653 </directive>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1654
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1655
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1656 <directive name="server_name_in_redirect">
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1657 <syntax>server_name_in_redirect <value>on</value> | <value>off</value></syntax>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1658 <default>server_name_in_redirect on</default>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1659 <context>http</context>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1660 <context>server</context>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1661 <context>location</context>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1662
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1663 <para>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1664 Enables or disables the use of the primary server name, specified by the
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1665 <link id="server_name">server_name</link>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1666 directive, in redirects issued by nginx.
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1667 When disabled, the name from the <header>Host</header> request header string
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1668 is used.
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1669 If there's no such a string, an IP address of the server is used.
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1670 </para>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1671
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1672 </directive>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1673
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1674
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1675 <directive name="server_names_hash_max_size">
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1676 <syntax>server_names_hash_max_size <argument>size</argument></syntax>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1677 <default>server_names_hash_max_size 512</default>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1678 <context>http</context>
3996
fc808f006ff4 skeleton for documentation processing
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
1679
fc808f006ff4 skeleton for documentation processing
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
1680 <para>
4068
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1681 Sets the maximum <argument>size</argument> of the server names hash tables.
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1682 For more information, please refer to
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1683 <link doc="/docs/hash.xml">Setting Up Hashes</link>.
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1684 </para>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1685
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1686 </directive>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1687
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1688
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1689 <directive name="server_names_hash_bucket_size">
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1690 <syntax>server_names_hash_bucket_size <argument>size</argument></syntax>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1691 <default>server_names_hash_bucket_size 32/64/128</default>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1692 <context>http</context>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1693
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1694 <para>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1695 Sets the bucket size for the server names hash tables.
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1696 Default value depends on the size of the processor's cache line.
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1697 For more information, please refer to
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1698 <link doc="/docs/hash.xml">Setting Up Hashes</link>.
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1699 </para>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1700
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1701 </directive>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1702
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1703
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1704 <directive name="server_tokens">
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1705 <syntax>server_tokens <value>on</value> | <value>off</value></syntax>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1706 <default>server_tokens on</default>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1707 <context>http</context>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1708 <context>server</context>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1709 <context>location</context>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1710
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1711 <para>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1712 Enables or disables emitting of nginx version in error messages and in the
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1713 <header>Server</header> response header string.
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1714 </para>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1715
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1716 </directive>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1717
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1718
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1719 <directive name="tcp_nodelay">
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1720 <syntax>tcp_nodelay <value>on</value> | <value>off</value></syntax>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1721 <default>tcp_nodelay on</default>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1722 <context>http</context>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1723 <context>server</context>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1724 <context>location</context>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1725
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1726 <para>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1727 Enables or disables the use of the <c-def>TCP_NODELAY</c-def> option.
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1728 The option is enabled only when a connection is transitioned into the
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1729 keep-alive state.
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1730 </para>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1731
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1732 </directive>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1733
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1734
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1735 <directive name="tcp_nopush">
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1736 <syntax>tcp_nopush <value>on</value> | <value>off</value></syntax>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1737 <default>tcp_nopush off</default>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1738 <context>http</context>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1739 <context>server</context>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1740 <context>location</context>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1741
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1742 <para>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1743 Enables or disables the use of
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1744 the <c-def>TCP_NOPUSH</c-def> socket option on FreeBSD
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1745 or the <c-def>TCP_CORK</c-def> socket option on Linux.
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1746 Opitons are enables only when <link id="sendfile">sendfile</link> is used.
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1747 Enabling the option allows to
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1748 <list type="bullet">
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1749
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1750 <listitem>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1751 send the response header and the beginning of a file in one packet,
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1752 on Linux and FreeBSD&nbsp;4.*;
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1753 </listitem>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1754
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1755 <listitem>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1756 send a file in full packets.
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1757 </listitem>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1758
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1759 </list>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1760 </para>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1761
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1762 </directive>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1763
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1764
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1765 <directive name="try_files">
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1766 <syntax>try_files <argument>file ... uri</argument></syntax>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1767 <syntax>try_files <argument>file ...</argument> =<argument>code</argument></syntax>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1768 <default/>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1769 <context>location</context>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1770
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1771 <para>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1772 Checks the existence of files in the specified order, and uses
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1773 the first found file for request processing; the processing
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1774 is performed in this location's context.
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1775 It is possible to check the directory existence by specifying
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1776 the slash at the end of a name, e.g. "<code>$uri/</code>".
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1777 If none of the files were found, an internal redirect to the
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1778 <argument>uri</argument> specified by the last argument is made.
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1779 As of version 0.7.51, the last argument can also be a
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1780 <argument>code</argument>:
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1781 <example>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1782 location / {
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1783 try_files $uri $uri/index.html $uri.html =404;
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1784 }
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1785 </example>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1786 </para>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1787
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1788 <para>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1789 Example when proxying Mongrel:
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1790 <example>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1791 location / {
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1792 try_files /system/maintenance.html
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1793 $uri $uri/index.html $uri.html
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1794 @mongrel;
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1795 }
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1796
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1797 location @mongrel {
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1798 proxy_pass http://mongrel;
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1799 }
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1800 </example>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1801 </para>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1802
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1803 <para>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1804 Example for Drupal/FastCGI:
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1805 <example>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1806 location / {
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1807 try_files $uri $uri/ @drupal;
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1808 }
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1809
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1810 location ~ \.php$ {
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1811 try_files $uri @drupal;
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1812
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1813 fastcgi_pass ...;
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1814
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1815 fastcgi_param SCRIPT_FILENAME /path/to$fastcgi_script_name;
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1816 fastcgi_param SCRIPT_NAME $fastcgi_script_name;
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1817 fastcgi_param QUERY_STRING $args;
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1818
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1819 ... other fastcgi_param's
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1820 }
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1821
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1822 location @drupal {
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1823 fastcgi_pass ...;
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1824
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1825 fastcgi_param SCRIPT_FILENAME /path/to/index.php;
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1826 fastcgi_param SCRIPT_NAME /index.php;
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1827 fastcgi_param QUERY_STRING q=$uri&amp;$args;
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1828
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1829 ... other fastcgi_param's
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1830 }
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1831 </example>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1832 In the following example,
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1833 <example>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1834 location / {
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1835 try_files $uri $uri/ @drupal;
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1836 }
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1837 </example>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1838 the <command>try_files</command> directive is equivalent to
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1839 <example>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1840 location / {
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1841 error_page 404 = @drupal;
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1842 log_not_found off;
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1843 }
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1844 </example>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1845 And here,
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1846 <example>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1847 location ~ \.php$ {
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1848 try_files $uri @drupal;
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1849
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1850 fastcgi_pass ...;
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1851
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1852 fastcgi_param SCRIPT_FILENAME /path/to$fastcgi_script_name;
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1853
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1854 ...
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1855 }
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1856 </example>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1857 <command>try_files</command> checks the existence of the PHP file
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1858 before passing the request to the FastCGI server.
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1859 </para>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1860
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1861 <para>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1862 Example for Wordpress and Joomla:
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1863 <example>
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1864 location / {
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1865 try_files $uri $uri/ @wordpress;
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1866 }
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1867
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1868 location ~ \.php$ {
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1869 try_files $uri @wordpress;
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1870
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1871 fastcgi_pass ...;
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1872
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1873 fastcgi_param SCRIPT_FILENAME /path/to$fastcgi_script_name;
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1874 ... other fastcgi_param's
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1875 }
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1876
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1877 location @wordpress {
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1878 fastcgi_pass ...;
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1879
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1880 fastcgi_param SCRIPT_FILENAME /path/to/index.php;
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1881 ... other fastcgi_param's
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1882 }
22364b1f61c9 Initial English translation of Core and HTTP Core modules.
Ruslan Ermilov <ru@nginx.com>
parents: 3996
diff changeset
1883 </example>
3996
fc808f006ff4 skeleton for documentation processing
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
1884 </para>
fc808f006ff4 skeleton for documentation processing
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
1885
fc808f006ff4 skeleton for documentation processing
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
1886 </directive>
fc808f006ff4 skeleton for documentation processing
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
1887
fc808f006ff4 skeleton for documentation processing
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
1888 </section>
fc808f006ff4 skeleton for documentation processing
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
1889
fc808f006ff4 skeleton for documentation processing
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
1890 </module>