annotate xml/en/docs/http/ngx_http_proxy_module.xml @ 1028:e582a10b1917

Documented the "proxy_cache_purge" and "fastcgi_cache_purge" directives.
author Vladimir Homutov <vl@nginx.com>
date Mon, 02 Dec 2013 15:24:51 +0400
parents af77dd40abeb
children 379cb572a7ec
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
281
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
1 <?xml version="1.0"?>
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
2
580
be54c443235a Added copyright markers to documentation sources.
Ruslan Ermilov <ru@nginx.com>
parents: 575
diff changeset
3 <!--
be54c443235a Added copyright markers to documentation sources.
Ruslan Ermilov <ru@nginx.com>
parents: 575
diff changeset
4 Copyright (C) Igor Sysoev
be54c443235a Added copyright markers to documentation sources.
Ruslan Ermilov <ru@nginx.com>
parents: 575
diff changeset
5 Copyright (C) Nginx, Inc.
be54c443235a Added copyright markers to documentation sources.
Ruslan Ermilov <ru@nginx.com>
parents: 575
diff changeset
6 -->
be54c443235a Added copyright markers to documentation sources.
Ruslan Ermilov <ru@nginx.com>
parents: 575
diff changeset
7
281
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
8 <!DOCTYPE module SYSTEM "../../../../dtd/module.dtd">
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
9
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
10 <module name="Module ngx_http_proxy_module"
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
11 link="/en/docs/http/ngx_http_proxy_module.html"
589
764fbac1b8b4 Added document revision.
Ruslan Ermilov <ru@nginx.com>
parents: 580
diff changeset
12 lang="en"
1028
e582a10b1917 Documented the "proxy_cache_purge" and "fastcgi_cache_purge" directives.
Vladimir Homutov <vl@nginx.com>
parents: 1015
diff changeset
13 rev="17">
281
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
14
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
15 <section id="summary">
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
16
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
17 <para>
959
fbb4cc6f8c3d Text review of ngx_http_proxy_module.
Egor Nikitin <yegor.nikitin@gmail.com>
parents: 942
diff changeset
18 The <literal>ngx_http_proxy_module</literal> module allows passing
281
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
19 requests to another server.
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
20 </para>
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
21
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
22 </section>
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
23
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
24
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
25 <section id="example" name="Example Configuration">
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
26
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
27 <para>
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
28 <example>
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
29 location / {
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
30 proxy_pass http://localhost:8000;
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
31 proxy_set_header Host $host;
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
32 proxy_set_header X-Real-IP $remote_addr;
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
33 }
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
34 </example>
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
35 </para>
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
36
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
37 </section>
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
38
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
39
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
40 <section id="directives" name="Directives">
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
41
772
ce121bf644f5 Documented "bind" directive in memcached, fastcgi and proxy modules.
Vladimir Homutov <vl@nginx.com>
parents: 589
diff changeset
42 <directive name="proxy_bind">
815
ed29fd8be462 *_bind: variables support and inheritance.
Ruslan Ermilov <ru@nginx.com>
parents: 799
diff changeset
43 <syntax><value>address</value> | <literal>off</literal></syntax>
772
ce121bf644f5 Documented "bind" directive in memcached, fastcgi and proxy modules.
Vladimir Homutov <vl@nginx.com>
parents: 589
diff changeset
44 <default/>
ce121bf644f5 Documented "bind" directive in memcached, fastcgi and proxy modules.
Vladimir Homutov <vl@nginx.com>
parents: 589
diff changeset
45 <context>http</context>
ce121bf644f5 Documented "bind" directive in memcached, fastcgi and proxy modules.
Vladimir Homutov <vl@nginx.com>
parents: 589
diff changeset
46 <context>server</context>
ce121bf644f5 Documented "bind" directive in memcached, fastcgi and proxy modules.
Vladimir Homutov <vl@nginx.com>
parents: 589
diff changeset
47 <context>location</context>
ce121bf644f5 Documented "bind" directive in memcached, fastcgi and proxy modules.
Vladimir Homutov <vl@nginx.com>
parents: 589
diff changeset
48 <appeared-in>0.8.22</appeared-in>
ce121bf644f5 Documented "bind" directive in memcached, fastcgi and proxy modules.
Vladimir Homutov <vl@nginx.com>
parents: 589
diff changeset
49
ce121bf644f5 Documented "bind" directive in memcached, fastcgi and proxy modules.
Vladimir Homutov <vl@nginx.com>
parents: 589
diff changeset
50 <para>
966
95c3c3bbf1ce Text review.
Egor Nikitin <yegor.nikitin@gmail.com>
parents: 959
diff changeset
51 Makes outgoing connections to a proxied server originate
772
ce121bf644f5 Documented "bind" directive in memcached, fastcgi and proxy modules.
Vladimir Homutov <vl@nginx.com>
parents: 589
diff changeset
52 from the specified local IP <value>address</value>.
966
95c3c3bbf1ce Text review.
Egor Nikitin <yegor.nikitin@gmail.com>
parents: 959
diff changeset
53 Parameter value can contain variables (1.3.12).
815
ed29fd8be462 *_bind: variables support and inheritance.
Ruslan Ermilov <ru@nginx.com>
parents: 799
diff changeset
54 The special value <literal>off</literal> (1.3.12) cancels the effect
ed29fd8be462 *_bind: variables support and inheritance.
Ruslan Ermilov <ru@nginx.com>
parents: 799
diff changeset
55 of the <literal>proxy_bind</literal> directive
966
95c3c3bbf1ce Text review.
Egor Nikitin <yegor.nikitin@gmail.com>
parents: 959
diff changeset
56 inherited from the previous configuration level, which allows the
959
fbb4cc6f8c3d Text review of ngx_http_proxy_module.
Egor Nikitin <yegor.nikitin@gmail.com>
parents: 942
diff changeset
57 system to auto-assign the local IP address.
772
ce121bf644f5 Documented "bind" directive in memcached, fastcgi and proxy modules.
Vladimir Homutov <vl@nginx.com>
parents: 589
diff changeset
58 </para>
ce121bf644f5 Documented "bind" directive in memcached, fastcgi and proxy modules.
Vladimir Homutov <vl@nginx.com>
parents: 589
diff changeset
59
ce121bf644f5 Documented "bind" directive in memcached, fastcgi and proxy modules.
Vladimir Homutov <vl@nginx.com>
parents: 589
diff changeset
60 </directive>
ce121bf644f5 Documented "bind" directive in memcached, fastcgi and proxy modules.
Vladimir Homutov <vl@nginx.com>
parents: 589
diff changeset
61
ce121bf644f5 Documented "bind" directive in memcached, fastcgi and proxy modules.
Vladimir Homutov <vl@nginx.com>
parents: 589
diff changeset
62
281
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
63 <directive name="proxy_buffer_size">
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
64 <syntax><value>size</value></syntax>
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
65 <default>4k|8k</default>
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
66 <context>http</context>
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
67 <context>server</context>
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
68 <context>location</context>
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
69
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
70 <para>
959
fbb4cc6f8c3d Text review of ngx_http_proxy_module.
Egor Nikitin <yegor.nikitin@gmail.com>
parents: 942
diff changeset
71 Sets the <value>size</value> of the buffer used for reading the first part
281
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
72 of a response received from the proxied server.
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
73 This part usually contains a small response header.
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
74 By default, the buffer size is equal to the size of one
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
75 buffer set by the <link id="proxy_buffers"/> directive.
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
76 It can be made smaller however.
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
77 </para>
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
78
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
79 </directive>
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
80
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
81
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
82 <directive name="proxy_buffering">
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
83 <syntax><literal>on</literal> | <literal>off</literal></syntax>
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
84 <default>on</default>
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
85 <context>http</context>
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
86 <context>server</context>
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
87 <context>location</context>
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
88
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
89 <para>
405
781b23ba3b0a Documented the following directives: proxy_busy_buffers_size,
Ruslan Ermilov <ru@nginx.com>
parents: 364
diff changeset
90 Enables or disables buffering of responses from the proxied server.
281
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
91 </para>
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
92
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
93 <para>
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
94 When buffering is enabled, nginx receives a response from the proxied server
959
fbb4cc6f8c3d Text review of ngx_http_proxy_module.
Egor Nikitin <yegor.nikitin@gmail.com>
parents: 942
diff changeset
95 as soon as possible, saving it into the buffers set by the
281
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
96 <link id="proxy_buffer_size"/> and <link id="proxy_buffers"/> directives.
959
fbb4cc6f8c3d Text review of ngx_http_proxy_module.
Egor Nikitin <yegor.nikitin@gmail.com>
parents: 942
diff changeset
97 If the whole response does not fit into memory, a part of it can be saved
fbb4cc6f8c3d Text review of ngx_http_proxy_module.
Egor Nikitin <yegor.nikitin@gmail.com>
parents: 942
diff changeset
98 to a <link id="proxy_temp_path">temporary file</link> on the disk.
fbb4cc6f8c3d Text review of ngx_http_proxy_module.
Egor Nikitin <yegor.nikitin@gmail.com>
parents: 942
diff changeset
99 Writing to temporary files is controlled by the
405
781b23ba3b0a Documented the following directives: proxy_busy_buffers_size,
Ruslan Ermilov <ru@nginx.com>
parents: 364
diff changeset
100 <link id="proxy_max_temp_file_size"/> and
781b23ba3b0a Documented the following directives: proxy_busy_buffers_size,
Ruslan Ermilov <ru@nginx.com>
parents: 364
diff changeset
101 <link id="proxy_temp_file_write_size"/> directives.
281
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
102 </para>
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
103
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
104 <para>
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
105 When buffering is disabled, a response is passed to a client synchronously,
362
db6774c4c699 Fixed translation.
Ruslan Ermilov <ru@nginx.com>
parents: 351
diff changeset
106 immediately as it is received.
281
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
107 nginx will not try to read the whole response from the proxied server.
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
108 The maximum size of the data that nginx can receive from the server
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
109 at a time is set by the <link id="proxy_buffer_size"/> directive.
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
110 </para>
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
111
506
657848837328 Documented how nginx processes proxied server's response header fields
Ruslan Ermilov <ru@nginx.com>
parents: 504
diff changeset
112 <para>
657848837328 Documented how nginx processes proxied server's response header fields
Ruslan Ermilov <ru@nginx.com>
parents: 504
diff changeset
113 Buffering can also be enabled or disabled by passing
657848837328 Documented how nginx processes proxied server's response header fields
Ruslan Ermilov <ru@nginx.com>
parents: 504
diff changeset
114 “<literal>yes</literal>” or “<literal>no</literal>” in the
657848837328 Documented how nginx processes proxied server's response header fields
Ruslan Ermilov <ru@nginx.com>
parents: 504
diff changeset
115 <header>X-Accel-Buffering</header> response header field.
959
fbb4cc6f8c3d Text review of ngx_http_proxy_module.
Egor Nikitin <yegor.nikitin@gmail.com>
parents: 942
diff changeset
116 This capability can be disabled using the
992
7cc496641627 Removed extraneous links.
Ruslan Ermilov <ru@nginx.com>
parents: 985
diff changeset
117 <link id="proxy_ignore_headers"/> directive.
506
657848837328 Documented how nginx processes proxied server's response header fields
Ruslan Ermilov <ru@nginx.com>
parents: 504
diff changeset
118 </para>
657848837328 Documented how nginx processes proxied server's response header fields
Ruslan Ermilov <ru@nginx.com>
parents: 504
diff changeset
119
281
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
120 </directive>
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
121
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
122
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
123 <directive name="proxy_buffers">
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
124 <syntax><value>number</value> <value>size</value></syntax>
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
125 <default>8 4k|8k</default>
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
126 <context>http</context>
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
127 <context>server</context>
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
128 <context>location</context>
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
129
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
130 <para>
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
131 Sets the <value>number</value> and <value>size</value> of
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
132 buffers used for reading a response from the proxied server,
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
133 for a single connection.
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
134 By default, the buffer size is equal to one memory page.
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
135 This is either 4K or 8K, depending on a platform.
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
136 </para>
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
137
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
138 </directive>
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
139
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
140
405
781b23ba3b0a Documented the following directives: proxy_busy_buffers_size,
Ruslan Ermilov <ru@nginx.com>
parents: 364
diff changeset
141 <directive name="proxy_busy_buffers_size">
781b23ba3b0a Documented the following directives: proxy_busy_buffers_size,
Ruslan Ermilov <ru@nginx.com>
parents: 364
diff changeset
142 <syntax><value>size</value></syntax>
781b23ba3b0a Documented the following directives: proxy_busy_buffers_size,
Ruslan Ermilov <ru@nginx.com>
parents: 364
diff changeset
143 <default>8k|16k</default>
781b23ba3b0a Documented the following directives: proxy_busy_buffers_size,
Ruslan Ermilov <ru@nginx.com>
parents: 364
diff changeset
144 <context>http</context>
781b23ba3b0a Documented the following directives: proxy_busy_buffers_size,
Ruslan Ermilov <ru@nginx.com>
parents: 364
diff changeset
145 <context>server</context>
781b23ba3b0a Documented the following directives: proxy_busy_buffers_size,
Ruslan Ermilov <ru@nginx.com>
parents: 364
diff changeset
146 <context>location</context>
781b23ba3b0a Documented the following directives: proxy_busy_buffers_size,
Ruslan Ermilov <ru@nginx.com>
parents: 364
diff changeset
147
781b23ba3b0a Documented the following directives: proxy_busy_buffers_size,
Ruslan Ermilov <ru@nginx.com>
parents: 364
diff changeset
148 <para>
781b23ba3b0a Documented the following directives: proxy_busy_buffers_size,
Ruslan Ermilov <ru@nginx.com>
parents: 364
diff changeset
149 When <link id="proxy_buffering">buffering</link> of responses from the proxied
781b23ba3b0a Documented the following directives: proxy_busy_buffers_size,
Ruslan Ermilov <ru@nginx.com>
parents: 364
diff changeset
150 server is enabled, limits the total <value>size</value> of buffers that
781b23ba3b0a Documented the following directives: proxy_busy_buffers_size,
Ruslan Ermilov <ru@nginx.com>
parents: 364
diff changeset
151 can be busy sending a response to the client while the response is not
781b23ba3b0a Documented the following directives: proxy_busy_buffers_size,
Ruslan Ermilov <ru@nginx.com>
parents: 364
diff changeset
152 yet fully read.
781b23ba3b0a Documented the following directives: proxy_busy_buffers_size,
Ruslan Ermilov <ru@nginx.com>
parents: 364
diff changeset
153 In the mean time, the rest of the buffers can be used for reading a response
781b23ba3b0a Documented the following directives: proxy_busy_buffers_size,
Ruslan Ermilov <ru@nginx.com>
parents: 364
diff changeset
154 and, if needed, buffering part of a response to a temporary file.
959
fbb4cc6f8c3d Text review of ngx_http_proxy_module.
Egor Nikitin <yegor.nikitin@gmail.com>
parents: 942
diff changeset
155 By default, <value>size</value> is limited by the size of two buffers set by the
405
781b23ba3b0a Documented the following directives: proxy_busy_buffers_size,
Ruslan Ermilov <ru@nginx.com>
parents: 364
diff changeset
156 <link id="proxy_buffer_size"/> and <link id="proxy_buffers"/> directives.
781b23ba3b0a Documented the following directives: proxy_busy_buffers_size,
Ruslan Ermilov <ru@nginx.com>
parents: 364
diff changeset
157 </para>
781b23ba3b0a Documented the following directives: proxy_busy_buffers_size,
Ruslan Ermilov <ru@nginx.com>
parents: 364
diff changeset
158
781b23ba3b0a Documented the following directives: proxy_busy_buffers_size,
Ruslan Ermilov <ru@nginx.com>
parents: 364
diff changeset
159 </directive>
781b23ba3b0a Documented the following directives: proxy_busy_buffers_size,
Ruslan Ermilov <ru@nginx.com>
parents: 364
diff changeset
160
781b23ba3b0a Documented the following directives: proxy_busy_buffers_size,
Ruslan Ermilov <ru@nginx.com>
parents: 364
diff changeset
161
281
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
162 <directive name="proxy_cache">
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
163 <syntax><value>zone</value> | <literal>off</literal></syntax>
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
164 <default>off</default>
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
165 <context>http</context>
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
166 <context>server</context>
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
167 <context>location</context>
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
168
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
169 <para>
575
ebcb351d9eb3 Consistently using the term "shared memory zone".
Ruslan Ermilov <ru@nginx.com>
parents: 535
diff changeset
170 Defines a shared memory zone used for caching.
281
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
171 The same zone can be used in several places.
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
172 The <literal>off</literal> parameter disables caching inherited
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
173 from the previous configuration level.
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
174 </para>
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
175
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
176 </directive>
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
177
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
178
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
179 <directive name="proxy_cache_bypass">
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
180 <syntax><value>string</value> ...</syntax>
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
181 <default/>
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
182 <context>http</context>
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
183 <context>server</context>
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
184 <context>location</context>
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
185
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
186 <para>
294
9f5ee1c6fca5 Use consistent wording.
Ruslan Ermilov <ru@nginx.com>
parents: 281
diff changeset
187 Defines conditions under which the response will not be taken from a cache.
281
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
188 If at least one value of the string parameters is not empty and is not
294
9f5ee1c6fca5 Use consistent wording.
Ruslan Ermilov <ru@nginx.com>
parents: 281
diff changeset
189 equal to “0” then the response will not be taken from the cache:
281
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
190 <example>
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
191 proxy_cache_bypass $cookie_nocache $arg_nocache$arg_comment;
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
192 proxy_cache_bypass $http_pragma $http_authorization;
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
193 </example>
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
194 Can be used along with the <link id="proxy_no_cache"/> directive.
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
195 </para>
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
196
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
197 </directive>
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
198
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
199
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
200 <directive name="proxy_cache_key">
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
201 <syntax><value>string</value></syntax>
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
202 <default>$scheme$proxy_host$request_uri</default>
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
203 <context>http</context>
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
204 <context>server</context>
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
205 <context>location</context>
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
206
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
207 <para>
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
208 Defines a key for caching, for example
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
209 <example>
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
210 proxy_cache_key "$host$request_uri $cookie_user";
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
211 </example>
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
212 By default, the directive’s value is close to the string
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
213 <example>
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
214 proxy_cache_key $scheme$proxy_host$uri$is_args$args;
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
215 </example>
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
216 </para>
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
217
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
218 </directive>
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
219
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
220
302
df728215db07 Documented "proxy_cache_lock", "proxy_cache_lock_timeout",
Ruslan Ermilov <ru@nginx.com>
parents: 297
diff changeset
221 <directive name="proxy_cache_lock">
df728215db07 Documented "proxy_cache_lock", "proxy_cache_lock_timeout",
Ruslan Ermilov <ru@nginx.com>
parents: 297
diff changeset
222 <syntax><literal>on</literal> | <literal>off</literal></syntax>
df728215db07 Documented "proxy_cache_lock", "proxy_cache_lock_timeout",
Ruslan Ermilov <ru@nginx.com>
parents: 297
diff changeset
223 <default>off</default>
df728215db07 Documented "proxy_cache_lock", "proxy_cache_lock_timeout",
Ruslan Ermilov <ru@nginx.com>
parents: 297
diff changeset
224 <context>http</context>
df728215db07 Documented "proxy_cache_lock", "proxy_cache_lock_timeout",
Ruslan Ermilov <ru@nginx.com>
parents: 297
diff changeset
225 <context>server</context>
df728215db07 Documented "proxy_cache_lock", "proxy_cache_lock_timeout",
Ruslan Ermilov <ru@nginx.com>
parents: 297
diff changeset
226 <context>location</context>
310
86732337c730 Added a historical information for proxy_cache_lock, proxy_cache_lock_timeout,
Ruslan Ermilov <ru@nginx.com>
parents: 302
diff changeset
227 <appeared-in>1.1.12</appeared-in>
302
df728215db07 Documented "proxy_cache_lock", "proxy_cache_lock_timeout",
Ruslan Ermilov <ru@nginx.com>
parents: 297
diff changeset
228
df728215db07 Documented "proxy_cache_lock", "proxy_cache_lock_timeout",
Ruslan Ermilov <ru@nginx.com>
parents: 297
diff changeset
229 <para>
df728215db07 Documented "proxy_cache_lock", "proxy_cache_lock_timeout",
Ruslan Ermilov <ru@nginx.com>
parents: 297
diff changeset
230 When enabled, only one request at a time will be allowed to populate
df728215db07 Documented "proxy_cache_lock", "proxy_cache_lock_timeout",
Ruslan Ermilov <ru@nginx.com>
parents: 297
diff changeset
231 a new cache element identified according to the <link id="proxy_cache_key"/>
df728215db07 Documented "proxy_cache_lock", "proxy_cache_lock_timeout",
Ruslan Ermilov <ru@nginx.com>
parents: 297
diff changeset
232 directive by passing a request to a proxied server.
df728215db07 Documented "proxy_cache_lock", "proxy_cache_lock_timeout",
Ruslan Ermilov <ru@nginx.com>
parents: 297
diff changeset
233 Other requests of the same cache element will either wait
959
fbb4cc6f8c3d Text review of ngx_http_proxy_module.
Egor Nikitin <yegor.nikitin@gmail.com>
parents: 942
diff changeset
234 for a response to appear in the cache or the cache lock for
302
df728215db07 Documented "proxy_cache_lock", "proxy_cache_lock_timeout",
Ruslan Ermilov <ru@nginx.com>
parents: 297
diff changeset
235 this element to be released, up to the time set by the
df728215db07 Documented "proxy_cache_lock", "proxy_cache_lock_timeout",
Ruslan Ermilov <ru@nginx.com>
parents: 297
diff changeset
236 <link id="proxy_cache_lock_timeout"/> directive.
df728215db07 Documented "proxy_cache_lock", "proxy_cache_lock_timeout",
Ruslan Ermilov <ru@nginx.com>
parents: 297
diff changeset
237 </para>
df728215db07 Documented "proxy_cache_lock", "proxy_cache_lock_timeout",
Ruslan Ermilov <ru@nginx.com>
parents: 297
diff changeset
238
df728215db07 Documented "proxy_cache_lock", "proxy_cache_lock_timeout",
Ruslan Ermilov <ru@nginx.com>
parents: 297
diff changeset
239 </directive>
df728215db07 Documented "proxy_cache_lock", "proxy_cache_lock_timeout",
Ruslan Ermilov <ru@nginx.com>
parents: 297
diff changeset
240
df728215db07 Documented "proxy_cache_lock", "proxy_cache_lock_timeout",
Ruslan Ermilov <ru@nginx.com>
parents: 297
diff changeset
241
df728215db07 Documented "proxy_cache_lock", "proxy_cache_lock_timeout",
Ruslan Ermilov <ru@nginx.com>
parents: 297
diff changeset
242 <directive name="proxy_cache_lock_timeout">
df728215db07 Documented "proxy_cache_lock", "proxy_cache_lock_timeout",
Ruslan Ermilov <ru@nginx.com>
parents: 297
diff changeset
243 <syntax><value>time</value></syntax>
df728215db07 Documented "proxy_cache_lock", "proxy_cache_lock_timeout",
Ruslan Ermilov <ru@nginx.com>
parents: 297
diff changeset
244 <default>5s</default>
df728215db07 Documented "proxy_cache_lock", "proxy_cache_lock_timeout",
Ruslan Ermilov <ru@nginx.com>
parents: 297
diff changeset
245 <context>http</context>
df728215db07 Documented "proxy_cache_lock", "proxy_cache_lock_timeout",
Ruslan Ermilov <ru@nginx.com>
parents: 297
diff changeset
246 <context>server</context>
df728215db07 Documented "proxy_cache_lock", "proxy_cache_lock_timeout",
Ruslan Ermilov <ru@nginx.com>
parents: 297
diff changeset
247 <context>location</context>
310
86732337c730 Added a historical information for proxy_cache_lock, proxy_cache_lock_timeout,
Ruslan Ermilov <ru@nginx.com>
parents: 302
diff changeset
248 <appeared-in>1.1.12</appeared-in>
302
df728215db07 Documented "proxy_cache_lock", "proxy_cache_lock_timeout",
Ruslan Ermilov <ru@nginx.com>
parents: 297
diff changeset
249
df728215db07 Documented "proxy_cache_lock", "proxy_cache_lock_timeout",
Ruslan Ermilov <ru@nginx.com>
parents: 297
diff changeset
250 <para>
df728215db07 Documented "proxy_cache_lock", "proxy_cache_lock_timeout",
Ruslan Ermilov <ru@nginx.com>
parents: 297
diff changeset
251 Sets a timeout for <link id="proxy_cache_lock"/>.
df728215db07 Documented "proxy_cache_lock", "proxy_cache_lock_timeout",
Ruslan Ermilov <ru@nginx.com>
parents: 297
diff changeset
252 </para>
df728215db07 Documented "proxy_cache_lock", "proxy_cache_lock_timeout",
Ruslan Ermilov <ru@nginx.com>
parents: 297
diff changeset
253
df728215db07 Documented "proxy_cache_lock", "proxy_cache_lock_timeout",
Ruslan Ermilov <ru@nginx.com>
parents: 297
diff changeset
254 </directive>
df728215db07 Documented "proxy_cache_lock", "proxy_cache_lock_timeout",
Ruslan Ermilov <ru@nginx.com>
parents: 297
diff changeset
255
df728215db07 Documented "proxy_cache_lock", "proxy_cache_lock_timeout",
Ruslan Ermilov <ru@nginx.com>
parents: 297
diff changeset
256
790
ae776a353984 Documented "proxy_cache_methods" directive.
Vladimir Homutov <vl@nginx.com>
parents: 789
diff changeset
257 <directive name="proxy_cache_methods">
ae776a353984 Documented "proxy_cache_methods" directive.
Vladimir Homutov <vl@nginx.com>
parents: 789
diff changeset
258 <syntax>
ae776a353984 Documented "proxy_cache_methods" directive.
Vladimir Homutov <vl@nginx.com>
parents: 789
diff changeset
259 <literal>GET</literal> |
ae776a353984 Documented "proxy_cache_methods" directive.
Vladimir Homutov <vl@nginx.com>
parents: 789
diff changeset
260 <literal>HEAD</literal> |
ae776a353984 Documented "proxy_cache_methods" directive.
Vladimir Homutov <vl@nginx.com>
parents: 789
diff changeset
261 <literal>POST</literal>
ae776a353984 Documented "proxy_cache_methods" directive.
Vladimir Homutov <vl@nginx.com>
parents: 789
diff changeset
262 ...</syntax>
ae776a353984 Documented "proxy_cache_methods" directive.
Vladimir Homutov <vl@nginx.com>
parents: 789
diff changeset
263 <default>GET HEAD</default>
ae776a353984 Documented "proxy_cache_methods" directive.
Vladimir Homutov <vl@nginx.com>
parents: 789
diff changeset
264 <context>http</context>
ae776a353984 Documented "proxy_cache_methods" directive.
Vladimir Homutov <vl@nginx.com>
parents: 789
diff changeset
265 <context>server</context>
ae776a353984 Documented "proxy_cache_methods" directive.
Vladimir Homutov <vl@nginx.com>
parents: 789
diff changeset
266 <context>location</context>
ae776a353984 Documented "proxy_cache_methods" directive.
Vladimir Homutov <vl@nginx.com>
parents: 789
diff changeset
267 <appeared-in>0.7.59</appeared-in>
ae776a353984 Documented "proxy_cache_methods" directive.
Vladimir Homutov <vl@nginx.com>
parents: 789
diff changeset
268
ae776a353984 Documented "proxy_cache_methods" directive.
Vladimir Homutov <vl@nginx.com>
parents: 789
diff changeset
269 <para>
ae776a353984 Documented "proxy_cache_methods" directive.
Vladimir Homutov <vl@nginx.com>
parents: 789
diff changeset
270 If the client request method is listed in this directive then
ae776a353984 Documented "proxy_cache_methods" directive.
Vladimir Homutov <vl@nginx.com>
parents: 789
diff changeset
271 the response will be cached.
ae776a353984 Documented "proxy_cache_methods" directive.
Vladimir Homutov <vl@nginx.com>
parents: 789
diff changeset
272 “<literal>GET</literal>” and “<literal>HEAD</literal>” methods are always
ae776a353984 Documented "proxy_cache_methods" directive.
Vladimir Homutov <vl@nginx.com>
parents: 789
diff changeset
273 added to the list, though it is recommended to specify them explicitly.
ae776a353984 Documented "proxy_cache_methods" directive.
Vladimir Homutov <vl@nginx.com>
parents: 789
diff changeset
274 See also the <link id="proxy_no_cache"/> directive.
ae776a353984 Documented "proxy_cache_methods" directive.
Vladimir Homutov <vl@nginx.com>
parents: 789
diff changeset
275 </para>
ae776a353984 Documented "proxy_cache_methods" directive.
Vladimir Homutov <vl@nginx.com>
parents: 789
diff changeset
276
ae776a353984 Documented "proxy_cache_methods" directive.
Vladimir Homutov <vl@nginx.com>
parents: 789
diff changeset
277 </directive>
ae776a353984 Documented "proxy_cache_methods" directive.
Vladimir Homutov <vl@nginx.com>
parents: 789
diff changeset
278
ae776a353984 Documented "proxy_cache_methods" directive.
Vladimir Homutov <vl@nginx.com>
parents: 789
diff changeset
279
281
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
280 <directive name="proxy_cache_min_uses">
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
281 <syntax><value>number</value></syntax>
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
282 <default>1</default>
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
283 <context>http</context>
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
284 <context>server</context>
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
285 <context>location</context>
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
286
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
287 <para>
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
288 Sets the <value>number</value> of requests after which the response
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
289 will be cached.
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
290 </para>
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
291
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
292 </directive>
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
293
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
294
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
295 <directive name="proxy_cache_path">
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
296 <syntax>
364
bb51d3e17dd0 Style fixed.
Ruslan Ermilov <ru@nginx.com>
parents: 362
diff changeset
297 <value>path</value>
bb51d3e17dd0 Style fixed.
Ruslan Ermilov <ru@nginx.com>
parents: 362
diff changeset
298 [<literal>levels</literal>=<value>levels</value>]
bb51d3e17dd0 Style fixed.
Ruslan Ermilov <ru@nginx.com>
parents: 362
diff changeset
299 <literal>keys_zone</literal>=<value>name</value>:<value>size</value>
bb51d3e17dd0 Style fixed.
Ruslan Ermilov <ru@nginx.com>
parents: 362
diff changeset
300 [<literal>inactive</literal>=<value>time</value>]
508
5e332fafd228 Documented "cache loader" and its parameters.
Ruslan Ermilov <ru@nginx.com>
parents: 506
diff changeset
301 [<literal>max_size</literal>=<value>size</value>]
5e332fafd228 Documented "cache loader" and its parameters.
Ruslan Ermilov <ru@nginx.com>
parents: 506
diff changeset
302 [<literal>loader_files</literal>=<value>number</value>]
5e332fafd228 Documented "cache loader" and its parameters.
Ruslan Ermilov <ru@nginx.com>
parents: 506
diff changeset
303 [<literal>loader_sleep</literal>=<value>time</value>]
5e332fafd228 Documented "cache loader" and its parameters.
Ruslan Ermilov <ru@nginx.com>
parents: 506
diff changeset
304 [<literal>loader_threshold</literal>=<value>time</value>]</syntax>
281
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
305 <default/>
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
306 <context>http</context>
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
307
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
308 <para>
959
fbb4cc6f8c3d Text review of ngx_http_proxy_module.
Egor Nikitin <yegor.nikitin@gmail.com>
parents: 942
diff changeset
309 Sets the path and other parameters of a cache.
281
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
310 Cache data are stored in files.
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
311 Both the key and file name in a cache are a result of
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
312 applying the MD5 function to the proxied URL.
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
313
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
314 The <literal>levels</literal> parameter defines hierarchy levels of a cache.
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
315 For example, in the following configuration
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
316 <example>
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
317 proxy_cache_path /data/nginx/cache levels=1:2 keys_zone=one:10m;
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
318 </example>
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
319 file names in a cache will look like this:
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
320 <example>
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
321 /data/nginx/cache/<emphasis>c</emphasis>/<emphasis>29</emphasis>/b7f54b2df7773722d382f4809d650<emphasis>29c</emphasis>
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
322 </example>
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
323 </para>
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
324
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
325 <para>
959
fbb4cc6f8c3d Text review of ngx_http_proxy_module.
Egor Nikitin <yegor.nikitin@gmail.com>
parents: 942
diff changeset
326 A cached response is first written to a temporary file,
966
95c3c3bbf1ce Text review.
Egor Nikitin <yegor.nikitin@gmail.com>
parents: 959
diff changeset
327 and then the file is renamed.
959
fbb4cc6f8c3d Text review of ngx_http_proxy_module.
Egor Nikitin <yegor.nikitin@gmail.com>
parents: 942
diff changeset
328 Starting from version 0.8.9, temporary files and the cache can be put on
966
95c3c3bbf1ce Text review.
Egor Nikitin <yegor.nikitin@gmail.com>
parents: 959
diff changeset
329 different file systems.
95c3c3bbf1ce Text review.
Egor Nikitin <yegor.nikitin@gmail.com>
parents: 959
diff changeset
330 However, be aware that in this case a file is copied
959
fbb4cc6f8c3d Text review of ngx_http_proxy_module.
Egor Nikitin <yegor.nikitin@gmail.com>
parents: 942
diff changeset
331 across two file systems instead of the cheap renaming operation.
281
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
332 It is thus recommended that for any given location both cache and a directory
959
fbb4cc6f8c3d Text review of ngx_http_proxy_module.
Egor Nikitin <yegor.nikitin@gmail.com>
parents: 942
diff changeset
333 holding temporary files, set by the <link id="proxy_temp_path"/> directive,
281
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
334 are put on the same file system.
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
335 </para>
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
336
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
337 <para>
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
338 In addition, all active keys and information about data are stored
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
339 in a shared memory zone, whose <value>name</value> and <value>size</value>
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
340 are configured by the <literal>keys_zone</literal> parameter.
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
341 Cached data that are not accessed during the time specified by the
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
342 <literal>inactive</literal> parameter get removed from the cache
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
343 regardless of their freshness.
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
344 By default, <literal>inactive</literal> is set to 10 minutes.
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
345 </para>
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
346
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
347 <para>
959
fbb4cc6f8c3d Text review of ngx_http_proxy_module.
Egor Nikitin <yegor.nikitin@gmail.com>
parents: 942
diff changeset
348 The special “cache manager” process monitors the maximum cache size set
fbb4cc6f8c3d Text review of ngx_http_proxy_module.
Egor Nikitin <yegor.nikitin@gmail.com>
parents: 942
diff changeset
349 by the <literal>max_size</literal> parameter.
fbb4cc6f8c3d Text review of ngx_http_proxy_module.
Egor Nikitin <yegor.nikitin@gmail.com>
parents: 942
diff changeset
350 When this size is exceeded, it removes the least recently used data.
281
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
351 </para>
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
352
508
5e332fafd228 Documented "cache loader" and its parameters.
Ruslan Ermilov <ru@nginx.com>
parents: 506
diff changeset
353 <para>
959
fbb4cc6f8c3d Text review of ngx_http_proxy_module.
Egor Nikitin <yegor.nikitin@gmail.com>
parents: 942
diff changeset
354 A minute after the start the special “cache loader” process is activated.
fbb4cc6f8c3d Text review of ngx_http_proxy_module.
Egor Nikitin <yegor.nikitin@gmail.com>
parents: 942
diff changeset
355 It loads information about previously cached data stored on file system
508
5e332fafd228 Documented "cache loader" and its parameters.
Ruslan Ermilov <ru@nginx.com>
parents: 506
diff changeset
356 into a cache zone.
959
fbb4cc6f8c3d Text review of ngx_http_proxy_module.
Egor Nikitin <yegor.nikitin@gmail.com>
parents: 942
diff changeset
357 The loading is done in iterations.
508
5e332fafd228 Documented "cache loader" and its parameters.
Ruslan Ermilov <ru@nginx.com>
parents: 506
diff changeset
358 During one iteration no more than <literal>loader_files</literal> items
5e332fafd228 Documented "cache loader" and its parameters.
Ruslan Ermilov <ru@nginx.com>
parents: 506
diff changeset
359 are loaded (by default, 100).
5e332fafd228 Documented "cache loader" and its parameters.
Ruslan Ermilov <ru@nginx.com>
parents: 506
diff changeset
360 Besides, the duration of one iteration is limited by the
5e332fafd228 Documented "cache loader" and its parameters.
Ruslan Ermilov <ru@nginx.com>
parents: 506
diff changeset
361 <literal>loader_threshold</literal> parameter (by default, 200 milliseconds).
959
fbb4cc6f8c3d Text review of ngx_http_proxy_module.
Egor Nikitin <yegor.nikitin@gmail.com>
parents: 942
diff changeset
362 Between iterations, a pause configured by the <literal>loader_sleep</literal>
fbb4cc6f8c3d Text review of ngx_http_proxy_module.
Egor Nikitin <yegor.nikitin@gmail.com>
parents: 942
diff changeset
363 parameter (by default, 50 milliseconds) is made.
508
5e332fafd228 Documented "cache loader" and its parameters.
Ruslan Ermilov <ru@nginx.com>
parents: 506
diff changeset
364 </para>
5e332fafd228 Documented "cache loader" and its parameters.
Ruslan Ermilov <ru@nginx.com>
parents: 506
diff changeset
365
281
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
366 </directive>
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
367
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
368
1028
e582a10b1917 Documented the "proxy_cache_purge" and "fastcgi_cache_purge" directives.
Vladimir Homutov <vl@nginx.com>
parents: 1015
diff changeset
369 <directive name="proxy_cache_purge">
e582a10b1917 Documented the "proxy_cache_purge" and "fastcgi_cache_purge" directives.
Vladimir Homutov <vl@nginx.com>
parents: 1015
diff changeset
370 <syntax>string ...</syntax>
e582a10b1917 Documented the "proxy_cache_purge" and "fastcgi_cache_purge" directives.
Vladimir Homutov <vl@nginx.com>
parents: 1015
diff changeset
371 <default/>
e582a10b1917 Documented the "proxy_cache_purge" and "fastcgi_cache_purge" directives.
Vladimir Homutov <vl@nginx.com>
parents: 1015
diff changeset
372 <context>http</context>
e582a10b1917 Documented the "proxy_cache_purge" and "fastcgi_cache_purge" directives.
Vladimir Homutov <vl@nginx.com>
parents: 1015
diff changeset
373 <context>server</context>
e582a10b1917 Documented the "proxy_cache_purge" and "fastcgi_cache_purge" directives.
Vladimir Homutov <vl@nginx.com>
parents: 1015
diff changeset
374 <context>location</context>
e582a10b1917 Documented the "proxy_cache_purge" and "fastcgi_cache_purge" directives.
Vladimir Homutov <vl@nginx.com>
parents: 1015
diff changeset
375 <appeared-in>1.5.7</appeared-in>
e582a10b1917 Documented the "proxy_cache_purge" and "fastcgi_cache_purge" directives.
Vladimir Homutov <vl@nginx.com>
parents: 1015
diff changeset
376
e582a10b1917 Documented the "proxy_cache_purge" and "fastcgi_cache_purge" directives.
Vladimir Homutov <vl@nginx.com>
parents: 1015
diff changeset
377 <para>
e582a10b1917 Documented the "proxy_cache_purge" and "fastcgi_cache_purge" directives.
Vladimir Homutov <vl@nginx.com>
parents: 1015
diff changeset
378 Defines conditions under which the request will be considered a cache
e582a10b1917 Documented the "proxy_cache_purge" and "fastcgi_cache_purge" directives.
Vladimir Homutov <vl@nginx.com>
parents: 1015
diff changeset
379 purge request.
e582a10b1917 Documented the "proxy_cache_purge" and "fastcgi_cache_purge" directives.
Vladimir Homutov <vl@nginx.com>
parents: 1015
diff changeset
380 If at least one value of the string parameters is not empty and is not equal
e582a10b1917 Documented the "proxy_cache_purge" and "fastcgi_cache_purge" directives.
Vladimir Homutov <vl@nginx.com>
parents: 1015
diff changeset
381 to “0” then the cache entry with a corresponding
e582a10b1917 Documented the "proxy_cache_purge" and "fastcgi_cache_purge" directives.
Vladimir Homutov <vl@nginx.com>
parents: 1015
diff changeset
382 <link id="proxy_cache_key">cache key</link> is removed.
e582a10b1917 Documented the "proxy_cache_purge" and "fastcgi_cache_purge" directives.
Vladimir Homutov <vl@nginx.com>
parents: 1015
diff changeset
383 The result of successful operation is indicated by returning
e582a10b1917 Documented the "proxy_cache_purge" and "fastcgi_cache_purge" directives.
Vladimir Homutov <vl@nginx.com>
parents: 1015
diff changeset
384 the <http-status code="204" text="No Content"/> response.
e582a10b1917 Documented the "proxy_cache_purge" and "fastcgi_cache_purge" directives.
Vladimir Homutov <vl@nginx.com>
parents: 1015
diff changeset
385 </para>
e582a10b1917 Documented the "proxy_cache_purge" and "fastcgi_cache_purge" directives.
Vladimir Homutov <vl@nginx.com>
parents: 1015
diff changeset
386
e582a10b1917 Documented the "proxy_cache_purge" and "fastcgi_cache_purge" directives.
Vladimir Homutov <vl@nginx.com>
parents: 1015
diff changeset
387 <para>
e582a10b1917 Documented the "proxy_cache_purge" and "fastcgi_cache_purge" directives.
Vladimir Homutov <vl@nginx.com>
parents: 1015
diff changeset
388 If the <link id="proxy_cache_key">cache key</link> of a purge request ends
e582a10b1917 Documented the "proxy_cache_purge" and "fastcgi_cache_purge" directives.
Vladimir Homutov <vl@nginx.com>
parents: 1015
diff changeset
389 with an asterisk (“<literal>*</literal>”), all cache entries matching the
e582a10b1917 Documented the "proxy_cache_purge" and "fastcgi_cache_purge" directives.
Vladimir Homutov <vl@nginx.com>
parents: 1015
diff changeset
390 wildcard key will be removed from the cache.
e582a10b1917 Documented the "proxy_cache_purge" and "fastcgi_cache_purge" directives.
Vladimir Homutov <vl@nginx.com>
parents: 1015
diff changeset
391 </para>
e582a10b1917 Documented the "proxy_cache_purge" and "fastcgi_cache_purge" directives.
Vladimir Homutov <vl@nginx.com>
parents: 1015
diff changeset
392
e582a10b1917 Documented the "proxy_cache_purge" and "fastcgi_cache_purge" directives.
Vladimir Homutov <vl@nginx.com>
parents: 1015
diff changeset
393 <para>
e582a10b1917 Documented the "proxy_cache_purge" and "fastcgi_cache_purge" directives.
Vladimir Homutov <vl@nginx.com>
parents: 1015
diff changeset
394 Example configuration:
e582a10b1917 Documented the "proxy_cache_purge" and "fastcgi_cache_purge" directives.
Vladimir Homutov <vl@nginx.com>
parents: 1015
diff changeset
395 <example>
e582a10b1917 Documented the "proxy_cache_purge" and "fastcgi_cache_purge" directives.
Vladimir Homutov <vl@nginx.com>
parents: 1015
diff changeset
396 proxy_cache_path /data/nginx/cache keys_zone=cache_zone:10m;
e582a10b1917 Documented the "proxy_cache_purge" and "fastcgi_cache_purge" directives.
Vladimir Homutov <vl@nginx.com>
parents: 1015
diff changeset
397
e582a10b1917 Documented the "proxy_cache_purge" and "fastcgi_cache_purge" directives.
Vladimir Homutov <vl@nginx.com>
parents: 1015
diff changeset
398 map $request_method $purge_method {
e582a10b1917 Documented the "proxy_cache_purge" and "fastcgi_cache_purge" directives.
Vladimir Homutov <vl@nginx.com>
parents: 1015
diff changeset
399 PURGE 1;
e582a10b1917 Documented the "proxy_cache_purge" and "fastcgi_cache_purge" directives.
Vladimir Homutov <vl@nginx.com>
parents: 1015
diff changeset
400 default 0;
e582a10b1917 Documented the "proxy_cache_purge" and "fastcgi_cache_purge" directives.
Vladimir Homutov <vl@nginx.com>
parents: 1015
diff changeset
401 }
e582a10b1917 Documented the "proxy_cache_purge" and "fastcgi_cache_purge" directives.
Vladimir Homutov <vl@nginx.com>
parents: 1015
diff changeset
402
e582a10b1917 Documented the "proxy_cache_purge" and "fastcgi_cache_purge" directives.
Vladimir Homutov <vl@nginx.com>
parents: 1015
diff changeset
403 server {
e582a10b1917 Documented the "proxy_cache_purge" and "fastcgi_cache_purge" directives.
Vladimir Homutov <vl@nginx.com>
parents: 1015
diff changeset
404 ...
e582a10b1917 Documented the "proxy_cache_purge" and "fastcgi_cache_purge" directives.
Vladimir Homutov <vl@nginx.com>
parents: 1015
diff changeset
405 location / {
e582a10b1917 Documented the "proxy_cache_purge" and "fastcgi_cache_purge" directives.
Vladimir Homutov <vl@nginx.com>
parents: 1015
diff changeset
406 proxy_pass http://backend;
e582a10b1917 Documented the "proxy_cache_purge" and "fastcgi_cache_purge" directives.
Vladimir Homutov <vl@nginx.com>
parents: 1015
diff changeset
407 proxy_cache cache_zone;
e582a10b1917 Documented the "proxy_cache_purge" and "fastcgi_cache_purge" directives.
Vladimir Homutov <vl@nginx.com>
parents: 1015
diff changeset
408 proxy_cache_key $uri;
e582a10b1917 Documented the "proxy_cache_purge" and "fastcgi_cache_purge" directives.
Vladimir Homutov <vl@nginx.com>
parents: 1015
diff changeset
409 proxy_cache_purge $purge_method;
e582a10b1917 Documented the "proxy_cache_purge" and "fastcgi_cache_purge" directives.
Vladimir Homutov <vl@nginx.com>
parents: 1015
diff changeset
410 }
e582a10b1917 Documented the "proxy_cache_purge" and "fastcgi_cache_purge" directives.
Vladimir Homutov <vl@nginx.com>
parents: 1015
diff changeset
411 }
e582a10b1917 Documented the "proxy_cache_purge" and "fastcgi_cache_purge" directives.
Vladimir Homutov <vl@nginx.com>
parents: 1015
diff changeset
412 </example>
e582a10b1917 Documented the "proxy_cache_purge" and "fastcgi_cache_purge" directives.
Vladimir Homutov <vl@nginx.com>
parents: 1015
diff changeset
413 <note>
e582a10b1917 Documented the "proxy_cache_purge" and "fastcgi_cache_purge" directives.
Vladimir Homutov <vl@nginx.com>
parents: 1015
diff changeset
414 This functionality is available as part of our <commercial_version/> only.
e582a10b1917 Documented the "proxy_cache_purge" and "fastcgi_cache_purge" directives.
Vladimir Homutov <vl@nginx.com>
parents: 1015
diff changeset
415 </note>
e582a10b1917 Documented the "proxy_cache_purge" and "fastcgi_cache_purge" directives.
Vladimir Homutov <vl@nginx.com>
parents: 1015
diff changeset
416 </para>
e582a10b1917 Documented the "proxy_cache_purge" and "fastcgi_cache_purge" directives.
Vladimir Homutov <vl@nginx.com>
parents: 1015
diff changeset
417
e582a10b1917 Documented the "proxy_cache_purge" and "fastcgi_cache_purge" directives.
Vladimir Homutov <vl@nginx.com>
parents: 1015
diff changeset
418 </directive>
e582a10b1917 Documented the "proxy_cache_purge" and "fastcgi_cache_purge" directives.
Vladimir Homutov <vl@nginx.com>
parents: 1015
diff changeset
419
e582a10b1917 Documented the "proxy_cache_purge" and "fastcgi_cache_purge" directives.
Vladimir Homutov <vl@nginx.com>
parents: 1015
diff changeset
420
1011
2ad2f30efdf2 Documented the "fastcgi_" and "proxy_cache_revalidate" directives.
Vladimir Homutov <vl@nginx.com>
parents: 1005
diff changeset
421 <directive name="proxy_cache_revalidate">
2ad2f30efdf2 Documented the "fastcgi_" and "proxy_cache_revalidate" directives.
Vladimir Homutov <vl@nginx.com>
parents: 1005
diff changeset
422 <syntax><literal>on</literal> | <literal>off</literal></syntax>
2ad2f30efdf2 Documented the "fastcgi_" and "proxy_cache_revalidate" directives.
Vladimir Homutov <vl@nginx.com>
parents: 1005
diff changeset
423 <default>off</default>
2ad2f30efdf2 Documented the "fastcgi_" and "proxy_cache_revalidate" directives.
Vladimir Homutov <vl@nginx.com>
parents: 1005
diff changeset
424 <context>http</context>
2ad2f30efdf2 Documented the "fastcgi_" and "proxy_cache_revalidate" directives.
Vladimir Homutov <vl@nginx.com>
parents: 1005
diff changeset
425 <context>server</context>
2ad2f30efdf2 Documented the "fastcgi_" and "proxy_cache_revalidate" directives.
Vladimir Homutov <vl@nginx.com>
parents: 1005
diff changeset
426 <context>location</context>
1015
af77dd40abeb Documented the appearance of "fastcgi_" and "proxy_cache_revalidate".
Vladimir Homutov <vl@nginx.com>
parents: 1011
diff changeset
427 <appeared-in>1.5.7</appeared-in>
1011
2ad2f30efdf2 Documented the "fastcgi_" and "proxy_cache_revalidate" directives.
Vladimir Homutov <vl@nginx.com>
parents: 1005
diff changeset
428
2ad2f30efdf2 Documented the "fastcgi_" and "proxy_cache_revalidate" directives.
Vladimir Homutov <vl@nginx.com>
parents: 1005
diff changeset
429 <para>
2ad2f30efdf2 Documented the "fastcgi_" and "proxy_cache_revalidate" directives.
Vladimir Homutov <vl@nginx.com>
parents: 1005
diff changeset
430 Enables revalidation of expired cache items using conditional requests with
2ad2f30efdf2 Documented the "fastcgi_" and "proxy_cache_revalidate" directives.
Vladimir Homutov <vl@nginx.com>
parents: 1005
diff changeset
431 the <header>If-Modified-Since</header> header field.
2ad2f30efdf2 Documented the "fastcgi_" and "proxy_cache_revalidate" directives.
Vladimir Homutov <vl@nginx.com>
parents: 1005
diff changeset
432 </para>
2ad2f30efdf2 Documented the "fastcgi_" and "proxy_cache_revalidate" directives.
Vladimir Homutov <vl@nginx.com>
parents: 1005
diff changeset
433
2ad2f30efdf2 Documented the "fastcgi_" and "proxy_cache_revalidate" directives.
Vladimir Homutov <vl@nginx.com>
parents: 1005
diff changeset
434 </directive>
2ad2f30efdf2 Documented the "fastcgi_" and "proxy_cache_revalidate" directives.
Vladimir Homutov <vl@nginx.com>
parents: 1005
diff changeset
435
2ad2f30efdf2 Documented the "fastcgi_" and "proxy_cache_revalidate" directives.
Vladimir Homutov <vl@nginx.com>
parents: 1005
diff changeset
436
281
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
437 <directive name="proxy_cache_use_stale">
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
438 <syntax>
364
bb51d3e17dd0 Style fixed.
Ruslan Ermilov <ru@nginx.com>
parents: 362
diff changeset
439 <literal>error</literal> |
bb51d3e17dd0 Style fixed.
Ruslan Ermilov <ru@nginx.com>
parents: 362
diff changeset
440 <literal>timeout</literal> |
bb51d3e17dd0 Style fixed.
Ruslan Ermilov <ru@nginx.com>
parents: 362
diff changeset
441 <literal>invalid_header</literal> |
bb51d3e17dd0 Style fixed.
Ruslan Ermilov <ru@nginx.com>
parents: 362
diff changeset
442 <literal>updating</literal> |
bb51d3e17dd0 Style fixed.
Ruslan Ermilov <ru@nginx.com>
parents: 362
diff changeset
443 <literal>http_500</literal> |
bb51d3e17dd0 Style fixed.
Ruslan Ermilov <ru@nginx.com>
parents: 362
diff changeset
444 <literal>http_502</literal> |
bb51d3e17dd0 Style fixed.
Ruslan Ermilov <ru@nginx.com>
parents: 362
diff changeset
445 <literal>http_503</literal> |
bb51d3e17dd0 Style fixed.
Ruslan Ermilov <ru@nginx.com>
parents: 362
diff changeset
446 <literal>http_504</literal> |
917
e26a18eb5ccd Documented http_403 in proxy_next_upstream and friends.
Maxim Dounin <mdounin@mdounin.ru>
parents: 907
diff changeset
447 <literal>http_403</literal> |
364
bb51d3e17dd0 Style fixed.
Ruslan Ermilov <ru@nginx.com>
parents: 362
diff changeset
448 <literal>http_404</literal> |
bb51d3e17dd0 Style fixed.
Ruslan Ermilov <ru@nginx.com>
parents: 362
diff changeset
449 <literal>off</literal>
bb51d3e17dd0 Style fixed.
Ruslan Ermilov <ru@nginx.com>
parents: 362
diff changeset
450 ...</syntax>
281
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
451 <default>off</default>
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
452 <context>http</context>
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
453 <context>server</context>
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
454 <context>location</context>
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
455
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
456 <para>
959
fbb4cc6f8c3d Text review of ngx_http_proxy_module.
Egor Nikitin <yegor.nikitin@gmail.com>
parents: 942
diff changeset
457 Determines in which cases a stale cached response can be used
966
95c3c3bbf1ce Text review.
Egor Nikitin <yegor.nikitin@gmail.com>
parents: 959
diff changeset
458 when an error occurs during communication with the proxied server.
959
fbb4cc6f8c3d Text review of ngx_http_proxy_module.
Egor Nikitin <yegor.nikitin@gmail.com>
parents: 942
diff changeset
459 The directive’s parameters match the parameters of the
281
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
460 <link id="proxy_next_upstream"/> directive.
504
695f83494c19 Emphasized on what the "updating" parameter of the "proxy_cache_use_stale"
Ruslan Ermilov <ru@nginx.com>
parents: 417
diff changeset
461 </para>
695f83494c19 Emphasized on what the "updating" parameter of the "proxy_cache_use_stale"
Ruslan Ermilov <ru@nginx.com>
parents: 417
diff changeset
462
695f83494c19 Emphasized on what the "updating" parameter of the "proxy_cache_use_stale"
Ruslan Ermilov <ru@nginx.com>
parents: 417
diff changeset
463 <para>
281
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
464 Additionally, the <literal>updating</literal> parameter permits
959
fbb4cc6f8c3d Text review of ngx_http_proxy_module.
Egor Nikitin <yegor.nikitin@gmail.com>
parents: 942
diff changeset
465 using a stale cached response if it is currently being updated.
fbb4cc6f8c3d Text review of ngx_http_proxy_module.
Egor Nikitin <yegor.nikitin@gmail.com>
parents: 942
diff changeset
466 This allows minimizing the number of accesses to proxied servers
504
695f83494c19 Emphasized on what the "updating" parameter of the "proxy_cache_use_stale"
Ruslan Ermilov <ru@nginx.com>
parents: 417
diff changeset
467 when updating cached data.
695f83494c19 Emphasized on what the "updating" parameter of the "proxy_cache_use_stale"
Ruslan Ermilov <ru@nginx.com>
parents: 417
diff changeset
468 </para>
695f83494c19 Emphasized on what the "updating" parameter of the "proxy_cache_use_stale"
Ruslan Ermilov <ru@nginx.com>
parents: 417
diff changeset
469
695f83494c19 Emphasized on what the "updating" parameter of the "proxy_cache_use_stale"
Ruslan Ermilov <ru@nginx.com>
parents: 417
diff changeset
470 <para>
695f83494c19 Emphasized on what the "updating" parameter of the "proxy_cache_use_stale"
Ruslan Ermilov <ru@nginx.com>
parents: 417
diff changeset
471 To minimize the number of accesses to proxied servers when
695f83494c19 Emphasized on what the "updating" parameter of the "proxy_cache_use_stale"
Ruslan Ermilov <ru@nginx.com>
parents: 417
diff changeset
472 populating a new cache element, the <link id="proxy_cache_lock"/>
695f83494c19 Emphasized on what the "updating" parameter of the "proxy_cache_use_stale"
Ruslan Ermilov <ru@nginx.com>
parents: 417
diff changeset
473 directive can be used.
281
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
474 </para>
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
475
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
476 </directive>
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
477
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
478
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
479 <directive name="proxy_cache_valid">
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
480 <syntax>[<value>code</value> ...] <value>time</value></syntax>
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
481 <default/>
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
482 <context>http</context>
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
483 <context>server</context>
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
484 <context>location</context>
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
485
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
486 <para>
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
487 Sets caching time for different response codes.
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
488 For example, the following directives
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
489 <example>
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
490 proxy_cache_valid 200 302 10m;
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
491 proxy_cache_valid 404 1m;
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
492 </example>
966
95c3c3bbf1ce Text review.
Egor Nikitin <yegor.nikitin@gmail.com>
parents: 959
diff changeset
493 set 10 minutes of caching for responses with codes 200 and 302
281
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
494 and 1 minute for responses with code 404.
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
495 </para>
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
496
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
497 <para>
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
498 If only caching <value>time</value> is specified
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
499 <example>
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
500 proxy_cache_valid 5m;
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
501 </example>
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
502 then only 200, 301, and 302 responses are cached.
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
503 </para>
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
504
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
505 <para>
959
fbb4cc6f8c3d Text review of ngx_http_proxy_module.
Egor Nikitin <yegor.nikitin@gmail.com>
parents: 942
diff changeset
506 In addition, the <literal>any</literal> parameter can be specified
fbb4cc6f8c3d Text review of ngx_http_proxy_module.
Egor Nikitin <yegor.nikitin@gmail.com>
parents: 942
diff changeset
507 to cache any responses:
281
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
508 <example>
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
509 proxy_cache_valid 200 302 10m;
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
510 proxy_cache_valid 301 1h;
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
511 proxy_cache_valid any 1m;
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
512 </example>
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
513 </para>
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
514
506
657848837328 Documented how nginx processes proxied server's response header fields
Ruslan Ermilov <ru@nginx.com>
parents: 504
diff changeset
515 <para>
657848837328 Documented how nginx processes proxied server's response header fields
Ruslan Ermilov <ru@nginx.com>
parents: 504
diff changeset
516 Parameters of caching can also be set directly
657848837328 Documented how nginx processes proxied server's response header fields
Ruslan Ermilov <ru@nginx.com>
parents: 504
diff changeset
517 in the response header.
959
fbb4cc6f8c3d Text review of ngx_http_proxy_module.
Egor Nikitin <yegor.nikitin@gmail.com>
parents: 942
diff changeset
518 This has higher priority than setting of caching time using the directive.
506
657848837328 Documented how nginx processes proxied server's response header fields
Ruslan Ermilov <ru@nginx.com>
parents: 504
diff changeset
519 The <header>X-Accel-Expires</header> header field sets caching time of a
657848837328 Documented how nginx processes proxied server's response header fields
Ruslan Ermilov <ru@nginx.com>
parents: 504
diff changeset
520 response in seconds.
966
95c3c3bbf1ce Text review.
Egor Nikitin <yegor.nikitin@gmail.com>
parents: 959
diff changeset
521 The zero value disables caching for a response.
959
fbb4cc6f8c3d Text review of ngx_http_proxy_module.
Egor Nikitin <yegor.nikitin@gmail.com>
parents: 942
diff changeset
522 If a value starts with the <literal>@</literal> prefix, it sets an absolute
506
657848837328 Documented how nginx processes proxied server's response header fields
Ruslan Ermilov <ru@nginx.com>
parents: 504
diff changeset
523 time in seconds since Epoch, up to which the response may be cached.
657848837328 Documented how nginx processes proxied server's response header fields
Ruslan Ermilov <ru@nginx.com>
parents: 504
diff changeset
524 If header does not include the <header>X-Accel-Expires</header> field,
657848837328 Documented how nginx processes proxied server's response header fields
Ruslan Ermilov <ru@nginx.com>
parents: 504
diff changeset
525 parameters of caching may be set in the header fields
657848837328 Documented how nginx processes proxied server's response header fields
Ruslan Ermilov <ru@nginx.com>
parents: 504
diff changeset
526 <header>Expires</header> or <header>Cache-Control</header>.
657848837328 Documented how nginx processes proxied server's response header fields
Ruslan Ermilov <ru@nginx.com>
parents: 504
diff changeset
527 If a header includes the <header>Set-Cookie</header> field, such a
657848837328 Documented how nginx processes proxied server's response header fields
Ruslan Ermilov <ru@nginx.com>
parents: 504
diff changeset
528 response will not be cached.
657848837328 Documented how nginx processes proxied server's response header fields
Ruslan Ermilov <ru@nginx.com>
parents: 504
diff changeset
529 Processing of one or more of these response header fields can be disabled
657848837328 Documented how nginx processes proxied server's response header fields
Ruslan Ermilov <ru@nginx.com>
parents: 504
diff changeset
530 using the <link id="proxy_ignore_headers"/> directive.
657848837328 Documented how nginx processes proxied server's response header fields
Ruslan Ermilov <ru@nginx.com>
parents: 504
diff changeset
531 </para>
657848837328 Documented how nginx processes proxied server's response header fields
Ruslan Ermilov <ru@nginx.com>
parents: 504
diff changeset
532
281
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
533 </directive>
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
534
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
535
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
536 <directive name="proxy_connect_timeout">
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
537 <syntax><value>time</value></syntax>
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
538 <default>60s</default>
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
539 <context>http</context>
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
540 <context>server</context>
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
541 <context>location</context>
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
542
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
543 <para>
959
fbb4cc6f8c3d Text review of ngx_http_proxy_module.
Egor Nikitin <yegor.nikitin@gmail.com>
parents: 942
diff changeset
544 Defines a timeout for establishing a connection with a proxied server.
281
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
545 It should be noted that this timeout cannot usually exceed 75 seconds.
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
546 </para>
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
547
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
548 </directive>
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
549
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
550
417
cbc2d1b51cb6 Documented the proxy_cookie_domain and proxy_cookie_path directives.
Ruslan Ermilov <ru@nginx.com>
parents: 405
diff changeset
551 <directive name="proxy_cookie_domain">
cbc2d1b51cb6 Documented the proxy_cookie_domain and proxy_cookie_path directives.
Ruslan Ermilov <ru@nginx.com>
parents: 405
diff changeset
552 <syntax><literal>off</literal></syntax>
cbc2d1b51cb6 Documented the proxy_cookie_domain and proxy_cookie_path directives.
Ruslan Ermilov <ru@nginx.com>
parents: 405
diff changeset
553 <syntax><value>domain</value> <value>replacement</value></syntax>
cbc2d1b51cb6 Documented the proxy_cookie_domain and proxy_cookie_path directives.
Ruslan Ermilov <ru@nginx.com>
parents: 405
diff changeset
554 <default>off</default>
cbc2d1b51cb6 Documented the proxy_cookie_domain and proxy_cookie_path directives.
Ruslan Ermilov <ru@nginx.com>
parents: 405
diff changeset
555 <context>http</context>
cbc2d1b51cb6 Documented the proxy_cookie_domain and proxy_cookie_path directives.
Ruslan Ermilov <ru@nginx.com>
parents: 405
diff changeset
556 <context>server</context>
cbc2d1b51cb6 Documented the proxy_cookie_domain and proxy_cookie_path directives.
Ruslan Ermilov <ru@nginx.com>
parents: 405
diff changeset
557 <context>location</context>
cbc2d1b51cb6 Documented the proxy_cookie_domain and proxy_cookie_path directives.
Ruslan Ermilov <ru@nginx.com>
parents: 405
diff changeset
558 <appeared-in>1.1.15</appeared-in>
cbc2d1b51cb6 Documented the proxy_cookie_domain and proxy_cookie_path directives.
Ruslan Ermilov <ru@nginx.com>
parents: 405
diff changeset
559
cbc2d1b51cb6 Documented the proxy_cookie_domain and proxy_cookie_path directives.
Ruslan Ermilov <ru@nginx.com>
parents: 405
diff changeset
560 <para>
cbc2d1b51cb6 Documented the proxy_cookie_domain and proxy_cookie_path directives.
Ruslan Ermilov <ru@nginx.com>
parents: 405
diff changeset
561 Sets a text that should be changed in the <literal>domain</literal>
cbc2d1b51cb6 Documented the proxy_cookie_domain and proxy_cookie_path directives.
Ruslan Ermilov <ru@nginx.com>
parents: 405
diff changeset
562 attribute of the <header>Set-Cookie</header> header fields of a
cbc2d1b51cb6 Documented the proxy_cookie_domain and proxy_cookie_path directives.
Ruslan Ermilov <ru@nginx.com>
parents: 405
diff changeset
563 proxied server response.
959
fbb4cc6f8c3d Text review of ngx_http_proxy_module.
Egor Nikitin <yegor.nikitin@gmail.com>
parents: 942
diff changeset
564 Suppose a proxied server returned the <header>Set-Cookie</header>
fbb4cc6f8c3d Text review of ngx_http_proxy_module.
Egor Nikitin <yegor.nikitin@gmail.com>
parents: 942
diff changeset
565 header field with the attribute
417
cbc2d1b51cb6 Documented the proxy_cookie_domain and proxy_cookie_path directives.
Ruslan Ermilov <ru@nginx.com>
parents: 405
diff changeset
566 “<literal>domain=localhost</literal>”.
cbc2d1b51cb6 Documented the proxy_cookie_domain and proxy_cookie_path directives.
Ruslan Ermilov <ru@nginx.com>
parents: 405
diff changeset
567 The directive
cbc2d1b51cb6 Documented the proxy_cookie_domain and proxy_cookie_path directives.
Ruslan Ermilov <ru@nginx.com>
parents: 405
diff changeset
568 <example>
cbc2d1b51cb6 Documented the proxy_cookie_domain and proxy_cookie_path directives.
Ruslan Ermilov <ru@nginx.com>
parents: 405
diff changeset
569 proxy_cookie_domain localhost example.org;
cbc2d1b51cb6 Documented the proxy_cookie_domain and proxy_cookie_path directives.
Ruslan Ermilov <ru@nginx.com>
parents: 405
diff changeset
570 </example>
cbc2d1b51cb6 Documented the proxy_cookie_domain and proxy_cookie_path directives.
Ruslan Ermilov <ru@nginx.com>
parents: 405
diff changeset
571 will rewrite this attribute to
cbc2d1b51cb6 Documented the proxy_cookie_domain and proxy_cookie_path directives.
Ruslan Ermilov <ru@nginx.com>
parents: 405
diff changeset
572 “<literal>domain=example.org</literal>”.
cbc2d1b51cb6 Documented the proxy_cookie_domain and proxy_cookie_path directives.
Ruslan Ermilov <ru@nginx.com>
parents: 405
diff changeset
573 </para>
cbc2d1b51cb6 Documented the proxy_cookie_domain and proxy_cookie_path directives.
Ruslan Ermilov <ru@nginx.com>
parents: 405
diff changeset
574
cbc2d1b51cb6 Documented the proxy_cookie_domain and proxy_cookie_path directives.
Ruslan Ermilov <ru@nginx.com>
parents: 405
diff changeset
575 <para>
cbc2d1b51cb6 Documented the proxy_cookie_domain and proxy_cookie_path directives.
Ruslan Ermilov <ru@nginx.com>
parents: 405
diff changeset
576 A dot at the beginning of the <value>domain</value> and
959
fbb4cc6f8c3d Text review of ngx_http_proxy_module.
Egor Nikitin <yegor.nikitin@gmail.com>
parents: 942
diff changeset
577 <value>replacement</value> strings and the <literal>domain</literal>
417
cbc2d1b51cb6 Documented the proxy_cookie_domain and proxy_cookie_path directives.
Ruslan Ermilov <ru@nginx.com>
parents: 405
diff changeset
578 attribute is ignored.
cbc2d1b51cb6 Documented the proxy_cookie_domain and proxy_cookie_path directives.
Ruslan Ermilov <ru@nginx.com>
parents: 405
diff changeset
579 Matching is case-insensitive.
cbc2d1b51cb6 Documented the proxy_cookie_domain and proxy_cookie_path directives.
Ruslan Ermilov <ru@nginx.com>
parents: 405
diff changeset
580 </para>
cbc2d1b51cb6 Documented the proxy_cookie_domain and proxy_cookie_path directives.
Ruslan Ermilov <ru@nginx.com>
parents: 405
diff changeset
581
cbc2d1b51cb6 Documented the proxy_cookie_domain and proxy_cookie_path directives.
Ruslan Ermilov <ru@nginx.com>
parents: 405
diff changeset
582 <para>
959
fbb4cc6f8c3d Text review of ngx_http_proxy_module.
Egor Nikitin <yegor.nikitin@gmail.com>
parents: 942
diff changeset
583 The <value>domain</value> and <value>replacement</value> strings
417
cbc2d1b51cb6 Documented the proxy_cookie_domain and proxy_cookie_path directives.
Ruslan Ermilov <ru@nginx.com>
parents: 405
diff changeset
584 can contain variables:
cbc2d1b51cb6 Documented the proxy_cookie_domain and proxy_cookie_path directives.
Ruslan Ermilov <ru@nginx.com>
parents: 405
diff changeset
585 <example>
cbc2d1b51cb6 Documented the proxy_cookie_domain and proxy_cookie_path directives.
Ruslan Ermilov <ru@nginx.com>
parents: 405
diff changeset
586 proxy_cookie_domain www.$host $host;
cbc2d1b51cb6 Documented the proxy_cookie_domain and proxy_cookie_path directives.
Ruslan Ermilov <ru@nginx.com>
parents: 405
diff changeset
587 </example>
cbc2d1b51cb6 Documented the proxy_cookie_domain and proxy_cookie_path directives.
Ruslan Ermilov <ru@nginx.com>
parents: 405
diff changeset
588 </para>
cbc2d1b51cb6 Documented the proxy_cookie_domain and proxy_cookie_path directives.
Ruslan Ermilov <ru@nginx.com>
parents: 405
diff changeset
589
cbc2d1b51cb6 Documented the proxy_cookie_domain and proxy_cookie_path directives.
Ruslan Ermilov <ru@nginx.com>
parents: 405
diff changeset
590 <para>
959
fbb4cc6f8c3d Text review of ngx_http_proxy_module.
Egor Nikitin <yegor.nikitin@gmail.com>
parents: 942
diff changeset
591 The directive can also be specified using regular expressions.
417
cbc2d1b51cb6 Documented the proxy_cookie_domain and proxy_cookie_path directives.
Ruslan Ermilov <ru@nginx.com>
parents: 405
diff changeset
592 In this case, <value>domain</value> should start from
cbc2d1b51cb6 Documented the proxy_cookie_domain and proxy_cookie_path directives.
Ruslan Ermilov <ru@nginx.com>
parents: 405
diff changeset
593 the “<literal>~</literal>” symbol.
cbc2d1b51cb6 Documented the proxy_cookie_domain and proxy_cookie_path directives.
Ruslan Ermilov <ru@nginx.com>
parents: 405
diff changeset
594 A regular expression can contain named and positional captures,
cbc2d1b51cb6 Documented the proxy_cookie_domain and proxy_cookie_path directives.
Ruslan Ermilov <ru@nginx.com>
parents: 405
diff changeset
595 and <value>replacement</value> can reference them:
cbc2d1b51cb6 Documented the proxy_cookie_domain and proxy_cookie_path directives.
Ruslan Ermilov <ru@nginx.com>
parents: 405
diff changeset
596 <example>
cbc2d1b51cb6 Documented the proxy_cookie_domain and proxy_cookie_path directives.
Ruslan Ermilov <ru@nginx.com>
parents: 405
diff changeset
597 proxy_cookie_domain ~\.(?P&lt;sl_domain&gt;[-0-9a-z]+\.[a-z]+)$ $sl_domain;
cbc2d1b51cb6 Documented the proxy_cookie_domain and proxy_cookie_path directives.
Ruslan Ermilov <ru@nginx.com>
parents: 405
diff changeset
598 </example>
cbc2d1b51cb6 Documented the proxy_cookie_domain and proxy_cookie_path directives.
Ruslan Ermilov <ru@nginx.com>
parents: 405
diff changeset
599 </para>
cbc2d1b51cb6 Documented the proxy_cookie_domain and proxy_cookie_path directives.
Ruslan Ermilov <ru@nginx.com>
parents: 405
diff changeset
600
cbc2d1b51cb6 Documented the proxy_cookie_domain and proxy_cookie_path directives.
Ruslan Ermilov <ru@nginx.com>
parents: 405
diff changeset
601 <para>
cbc2d1b51cb6 Documented the proxy_cookie_domain and proxy_cookie_path directives.
Ruslan Ermilov <ru@nginx.com>
parents: 405
diff changeset
602 There could be several <literal>proxy_cookie_domain</literal> directives:
cbc2d1b51cb6 Documented the proxy_cookie_domain and proxy_cookie_path directives.
Ruslan Ermilov <ru@nginx.com>
parents: 405
diff changeset
603 <example>
cbc2d1b51cb6 Documented the proxy_cookie_domain and proxy_cookie_path directives.
Ruslan Ermilov <ru@nginx.com>
parents: 405
diff changeset
604 proxy_cookie_domain localhost example.org;
cbc2d1b51cb6 Documented the proxy_cookie_domain and proxy_cookie_path directives.
Ruslan Ermilov <ru@nginx.com>
parents: 405
diff changeset
605 proxy_cookie_domain ~\.([a-z]+\.[a-z]+)$ $1;
cbc2d1b51cb6 Documented the proxy_cookie_domain and proxy_cookie_path directives.
Ruslan Ermilov <ru@nginx.com>
parents: 405
diff changeset
606 </example>
cbc2d1b51cb6 Documented the proxy_cookie_domain and proxy_cookie_path directives.
Ruslan Ermilov <ru@nginx.com>
parents: 405
diff changeset
607 </para>
cbc2d1b51cb6 Documented the proxy_cookie_domain and proxy_cookie_path directives.
Ruslan Ermilov <ru@nginx.com>
parents: 405
diff changeset
608
cbc2d1b51cb6 Documented the proxy_cookie_domain and proxy_cookie_path directives.
Ruslan Ermilov <ru@nginx.com>
parents: 405
diff changeset
609 <para>
959
fbb4cc6f8c3d Text review of ngx_http_proxy_module.
Egor Nikitin <yegor.nikitin@gmail.com>
parents: 942
diff changeset
610 The <literal>off</literal> parameter cancels the effect of all
417
cbc2d1b51cb6 Documented the proxy_cookie_domain and proxy_cookie_path directives.
Ruslan Ermilov <ru@nginx.com>
parents: 405
diff changeset
611 <literal>proxy_cookie_domain</literal> directives on the current level:
cbc2d1b51cb6 Documented the proxy_cookie_domain and proxy_cookie_path directives.
Ruslan Ermilov <ru@nginx.com>
parents: 405
diff changeset
612 <example>
cbc2d1b51cb6 Documented the proxy_cookie_domain and proxy_cookie_path directives.
Ruslan Ermilov <ru@nginx.com>
parents: 405
diff changeset
613 proxy_cookie_domain off;
cbc2d1b51cb6 Documented the proxy_cookie_domain and proxy_cookie_path directives.
Ruslan Ermilov <ru@nginx.com>
parents: 405
diff changeset
614 proxy_cookie_domain localhost example.org;
cbc2d1b51cb6 Documented the proxy_cookie_domain and proxy_cookie_path directives.
Ruslan Ermilov <ru@nginx.com>
parents: 405
diff changeset
615 proxy_cookie_domain www.example.org example.org;
cbc2d1b51cb6 Documented the proxy_cookie_domain and proxy_cookie_path directives.
Ruslan Ermilov <ru@nginx.com>
parents: 405
diff changeset
616 </example>
cbc2d1b51cb6 Documented the proxy_cookie_domain and proxy_cookie_path directives.
Ruslan Ermilov <ru@nginx.com>
parents: 405
diff changeset
617 </para>
cbc2d1b51cb6 Documented the proxy_cookie_domain and proxy_cookie_path directives.
Ruslan Ermilov <ru@nginx.com>
parents: 405
diff changeset
618
cbc2d1b51cb6 Documented the proxy_cookie_domain and proxy_cookie_path directives.
Ruslan Ermilov <ru@nginx.com>
parents: 405
diff changeset
619 </directive>
cbc2d1b51cb6 Documented the proxy_cookie_domain and proxy_cookie_path directives.
Ruslan Ermilov <ru@nginx.com>
parents: 405
diff changeset
620
cbc2d1b51cb6 Documented the proxy_cookie_domain and proxy_cookie_path directives.
Ruslan Ermilov <ru@nginx.com>
parents: 405
diff changeset
621
cbc2d1b51cb6 Documented the proxy_cookie_domain and proxy_cookie_path directives.
Ruslan Ermilov <ru@nginx.com>
parents: 405
diff changeset
622 <directive name="proxy_cookie_path">
cbc2d1b51cb6 Documented the proxy_cookie_domain and proxy_cookie_path directives.
Ruslan Ermilov <ru@nginx.com>
parents: 405
diff changeset
623 <syntax><literal>off</literal></syntax>
cbc2d1b51cb6 Documented the proxy_cookie_domain and proxy_cookie_path directives.
Ruslan Ermilov <ru@nginx.com>
parents: 405
diff changeset
624 <syntax><value>path</value> <value>replacement</value></syntax>
cbc2d1b51cb6 Documented the proxy_cookie_domain and proxy_cookie_path directives.
Ruslan Ermilov <ru@nginx.com>
parents: 405
diff changeset
625 <default>off</default>
cbc2d1b51cb6 Documented the proxy_cookie_domain and proxy_cookie_path directives.
Ruslan Ermilov <ru@nginx.com>
parents: 405
diff changeset
626 <context>http</context>
cbc2d1b51cb6 Documented the proxy_cookie_domain and proxy_cookie_path directives.
Ruslan Ermilov <ru@nginx.com>
parents: 405
diff changeset
627 <context>server</context>
cbc2d1b51cb6 Documented the proxy_cookie_domain and proxy_cookie_path directives.
Ruslan Ermilov <ru@nginx.com>
parents: 405
diff changeset
628 <context>location</context>
cbc2d1b51cb6 Documented the proxy_cookie_domain and proxy_cookie_path directives.
Ruslan Ermilov <ru@nginx.com>
parents: 405
diff changeset
629 <appeared-in>1.1.15</appeared-in>
cbc2d1b51cb6 Documented the proxy_cookie_domain and proxy_cookie_path directives.
Ruslan Ermilov <ru@nginx.com>
parents: 405
diff changeset
630
cbc2d1b51cb6 Documented the proxy_cookie_domain and proxy_cookie_path directives.
Ruslan Ermilov <ru@nginx.com>
parents: 405
diff changeset
631 <para>
cbc2d1b51cb6 Documented the proxy_cookie_domain and proxy_cookie_path directives.
Ruslan Ermilov <ru@nginx.com>
parents: 405
diff changeset
632 Sets a text that should be changed in the <literal>path</literal>
cbc2d1b51cb6 Documented the proxy_cookie_domain and proxy_cookie_path directives.
Ruslan Ermilov <ru@nginx.com>
parents: 405
diff changeset
633 attribute of the <header>Set-Cookie</header> header fields of a
cbc2d1b51cb6 Documented the proxy_cookie_domain and proxy_cookie_path directives.
Ruslan Ermilov <ru@nginx.com>
parents: 405
diff changeset
634 proxied server response.
959
fbb4cc6f8c3d Text review of ngx_http_proxy_module.
Egor Nikitin <yegor.nikitin@gmail.com>
parents: 942
diff changeset
635 Suppose a proxied server returned the <header>Set-Cookie</header>
fbb4cc6f8c3d Text review of ngx_http_proxy_module.
Egor Nikitin <yegor.nikitin@gmail.com>
parents: 942
diff changeset
636 header field with the attribute
417
cbc2d1b51cb6 Documented the proxy_cookie_domain and proxy_cookie_path directives.
Ruslan Ermilov <ru@nginx.com>
parents: 405
diff changeset
637 “<literal>path=/two/some/uri/</literal>”.
cbc2d1b51cb6 Documented the proxy_cookie_domain and proxy_cookie_path directives.
Ruslan Ermilov <ru@nginx.com>
parents: 405
diff changeset
638 The directive
cbc2d1b51cb6 Documented the proxy_cookie_domain and proxy_cookie_path directives.
Ruslan Ermilov <ru@nginx.com>
parents: 405
diff changeset
639 <example>
cbc2d1b51cb6 Documented the proxy_cookie_domain and proxy_cookie_path directives.
Ruslan Ermilov <ru@nginx.com>
parents: 405
diff changeset
640 proxy_cookie_path /two/ /;
cbc2d1b51cb6 Documented the proxy_cookie_domain and proxy_cookie_path directives.
Ruslan Ermilov <ru@nginx.com>
parents: 405
diff changeset
641 </example>
cbc2d1b51cb6 Documented the proxy_cookie_domain and proxy_cookie_path directives.
Ruslan Ermilov <ru@nginx.com>
parents: 405
diff changeset
642 will rewrite this attribute to
cbc2d1b51cb6 Documented the proxy_cookie_domain and proxy_cookie_path directives.
Ruslan Ermilov <ru@nginx.com>
parents: 405
diff changeset
643 “<literal>path=/some/uri/</literal>”.
cbc2d1b51cb6 Documented the proxy_cookie_domain and proxy_cookie_path directives.
Ruslan Ermilov <ru@nginx.com>
parents: 405
diff changeset
644 </para>
cbc2d1b51cb6 Documented the proxy_cookie_domain and proxy_cookie_path directives.
Ruslan Ermilov <ru@nginx.com>
parents: 405
diff changeset
645
cbc2d1b51cb6 Documented the proxy_cookie_domain and proxy_cookie_path directives.
Ruslan Ermilov <ru@nginx.com>
parents: 405
diff changeset
646 <para>
959
fbb4cc6f8c3d Text review of ngx_http_proxy_module.
Egor Nikitin <yegor.nikitin@gmail.com>
parents: 942
diff changeset
647 The <value>path</value> and <value>replacement</value> strings
417
cbc2d1b51cb6 Documented the proxy_cookie_domain and proxy_cookie_path directives.
Ruslan Ermilov <ru@nginx.com>
parents: 405
diff changeset
648 can contain variables:
cbc2d1b51cb6 Documented the proxy_cookie_domain and proxy_cookie_path directives.
Ruslan Ermilov <ru@nginx.com>
parents: 405
diff changeset
649 <example>
cbc2d1b51cb6 Documented the proxy_cookie_domain and proxy_cookie_path directives.
Ruslan Ermilov <ru@nginx.com>
parents: 405
diff changeset
650 proxy_cookie_path $uri /some$uri;
cbc2d1b51cb6 Documented the proxy_cookie_domain and proxy_cookie_path directives.
Ruslan Ermilov <ru@nginx.com>
parents: 405
diff changeset
651 </example>
cbc2d1b51cb6 Documented the proxy_cookie_domain and proxy_cookie_path directives.
Ruslan Ermilov <ru@nginx.com>
parents: 405
diff changeset
652 </para>
cbc2d1b51cb6 Documented the proxy_cookie_domain and proxy_cookie_path directives.
Ruslan Ermilov <ru@nginx.com>
parents: 405
diff changeset
653
cbc2d1b51cb6 Documented the proxy_cookie_domain and proxy_cookie_path directives.
Ruslan Ermilov <ru@nginx.com>
parents: 405
diff changeset
654 <para>
959
fbb4cc6f8c3d Text review of ngx_http_proxy_module.
Egor Nikitin <yegor.nikitin@gmail.com>
parents: 942
diff changeset
655 The directive can also be specified using regular expressions.
417
cbc2d1b51cb6 Documented the proxy_cookie_domain and proxy_cookie_path directives.
Ruslan Ermilov <ru@nginx.com>
parents: 405
diff changeset
656 In this case, <value>path</value> should either start from
cbc2d1b51cb6 Documented the proxy_cookie_domain and proxy_cookie_path directives.
Ruslan Ermilov <ru@nginx.com>
parents: 405
diff changeset
657 the “<literal>~</literal>” symbol for a case-sensitive matching,
cbc2d1b51cb6 Documented the proxy_cookie_domain and proxy_cookie_path directives.
Ruslan Ermilov <ru@nginx.com>
parents: 405
diff changeset
658 or from the “<literal>~*</literal>” symbols for case-insensitive
cbc2d1b51cb6 Documented the proxy_cookie_domain and proxy_cookie_path directives.
Ruslan Ermilov <ru@nginx.com>
parents: 405
diff changeset
659 matching.
cbc2d1b51cb6 Documented the proxy_cookie_domain and proxy_cookie_path directives.
Ruslan Ermilov <ru@nginx.com>
parents: 405
diff changeset
660 A regular expression can contain named and positional captures,
cbc2d1b51cb6 Documented the proxy_cookie_domain and proxy_cookie_path directives.
Ruslan Ermilov <ru@nginx.com>
parents: 405
diff changeset
661 and <value>replacement</value> can reference them:
cbc2d1b51cb6 Documented the proxy_cookie_domain and proxy_cookie_path directives.
Ruslan Ermilov <ru@nginx.com>
parents: 405
diff changeset
662 <example>
cbc2d1b51cb6 Documented the proxy_cookie_domain and proxy_cookie_path directives.
Ruslan Ermilov <ru@nginx.com>
parents: 405
diff changeset
663 proxy_cookie_path ~*^/user/([^/]+) /u/$1;
cbc2d1b51cb6 Documented the proxy_cookie_domain and proxy_cookie_path directives.
Ruslan Ermilov <ru@nginx.com>
parents: 405
diff changeset
664 </example>
cbc2d1b51cb6 Documented the proxy_cookie_domain and proxy_cookie_path directives.
Ruslan Ermilov <ru@nginx.com>
parents: 405
diff changeset
665 </para>
cbc2d1b51cb6 Documented the proxy_cookie_domain and proxy_cookie_path directives.
Ruslan Ermilov <ru@nginx.com>
parents: 405
diff changeset
666
cbc2d1b51cb6 Documented the proxy_cookie_domain and proxy_cookie_path directives.
Ruslan Ermilov <ru@nginx.com>
parents: 405
diff changeset
667 <para>
cbc2d1b51cb6 Documented the proxy_cookie_domain and proxy_cookie_path directives.
Ruslan Ermilov <ru@nginx.com>
parents: 405
diff changeset
668 There could be several <literal>proxy_cookie_path</literal> directives:
cbc2d1b51cb6 Documented the proxy_cookie_domain and proxy_cookie_path directives.
Ruslan Ermilov <ru@nginx.com>
parents: 405
diff changeset
669 <example>
cbc2d1b51cb6 Documented the proxy_cookie_domain and proxy_cookie_path directives.
Ruslan Ermilov <ru@nginx.com>
parents: 405
diff changeset
670 proxy_cookie_path /one/ /;
cbc2d1b51cb6 Documented the proxy_cookie_domain and proxy_cookie_path directives.
Ruslan Ermilov <ru@nginx.com>
parents: 405
diff changeset
671 proxy_cookie_path / /two/;
cbc2d1b51cb6 Documented the proxy_cookie_domain and proxy_cookie_path directives.
Ruslan Ermilov <ru@nginx.com>
parents: 405
diff changeset
672 </example>
cbc2d1b51cb6 Documented the proxy_cookie_domain and proxy_cookie_path directives.
Ruslan Ermilov <ru@nginx.com>
parents: 405
diff changeset
673 </para>
cbc2d1b51cb6 Documented the proxy_cookie_domain and proxy_cookie_path directives.
Ruslan Ermilov <ru@nginx.com>
parents: 405
diff changeset
674
cbc2d1b51cb6 Documented the proxy_cookie_domain and proxy_cookie_path directives.
Ruslan Ermilov <ru@nginx.com>
parents: 405
diff changeset
675 <para>
959
fbb4cc6f8c3d Text review of ngx_http_proxy_module.
Egor Nikitin <yegor.nikitin@gmail.com>
parents: 942
diff changeset
676 The <literal>off</literal> parameter cancels the effect of all
417
cbc2d1b51cb6 Documented the proxy_cookie_domain and proxy_cookie_path directives.
Ruslan Ermilov <ru@nginx.com>
parents: 405
diff changeset
677 <literal>proxy_cookie_path</literal> directives on the current level:
cbc2d1b51cb6 Documented the proxy_cookie_domain and proxy_cookie_path directives.
Ruslan Ermilov <ru@nginx.com>
parents: 405
diff changeset
678 <example>
cbc2d1b51cb6 Documented the proxy_cookie_domain and proxy_cookie_path directives.
Ruslan Ermilov <ru@nginx.com>
parents: 405
diff changeset
679 proxy_cookie_path off;
cbc2d1b51cb6 Documented the proxy_cookie_domain and proxy_cookie_path directives.
Ruslan Ermilov <ru@nginx.com>
parents: 405
diff changeset
680 proxy_cookie_path /two/ /;
cbc2d1b51cb6 Documented the proxy_cookie_domain and proxy_cookie_path directives.
Ruslan Ermilov <ru@nginx.com>
parents: 405
diff changeset
681 proxy_cookie_path ~*^/user/([^/]+) /u/$1;
cbc2d1b51cb6 Documented the proxy_cookie_domain and proxy_cookie_path directives.
Ruslan Ermilov <ru@nginx.com>
parents: 405
diff changeset
682 </example>
cbc2d1b51cb6 Documented the proxy_cookie_domain and proxy_cookie_path directives.
Ruslan Ermilov <ru@nginx.com>
parents: 405
diff changeset
683 </para>
cbc2d1b51cb6 Documented the proxy_cookie_domain and proxy_cookie_path directives.
Ruslan Ermilov <ru@nginx.com>
parents: 405
diff changeset
684
cbc2d1b51cb6 Documented the proxy_cookie_domain and proxy_cookie_path directives.
Ruslan Ermilov <ru@nginx.com>
parents: 405
diff changeset
685 </directive>
cbc2d1b51cb6 Documented the proxy_cookie_domain and proxy_cookie_path directives.
Ruslan Ermilov <ru@nginx.com>
parents: 405
diff changeset
686
cbc2d1b51cb6 Documented the proxy_cookie_domain and proxy_cookie_path directives.
Ruslan Ermilov <ru@nginx.com>
parents: 405
diff changeset
687
799
9e5847af3b2d Documented the "proxy_headers_hash_bucket/max_size" directives.
Vladimir Homutov <vl@nginx.com>
parents: 790
diff changeset
688 <directive name="proxy_headers_hash_bucket_size">
9e5847af3b2d Documented the "proxy_headers_hash_bucket/max_size" directives.
Vladimir Homutov <vl@nginx.com>
parents: 790
diff changeset
689 <syntax><value>size</value></syntax>
9e5847af3b2d Documented the "proxy_headers_hash_bucket/max_size" directives.
Vladimir Homutov <vl@nginx.com>
parents: 790
diff changeset
690 <default>64</default>
9e5847af3b2d Documented the "proxy_headers_hash_bucket/max_size" directives.
Vladimir Homutov <vl@nginx.com>
parents: 790
diff changeset
691 <context>http</context>
9e5847af3b2d Documented the "proxy_headers_hash_bucket/max_size" directives.
Vladimir Homutov <vl@nginx.com>
parents: 790
diff changeset
692 <context>server</context>
9e5847af3b2d Documented the "proxy_headers_hash_bucket/max_size" directives.
Vladimir Homutov <vl@nginx.com>
parents: 790
diff changeset
693 <context>location</context>
9e5847af3b2d Documented the "proxy_headers_hash_bucket/max_size" directives.
Vladimir Homutov <vl@nginx.com>
parents: 790
diff changeset
694
9e5847af3b2d Documented the "proxy_headers_hash_bucket/max_size" directives.
Vladimir Homutov <vl@nginx.com>
parents: 790
diff changeset
695 <para>
9e5847af3b2d Documented the "proxy_headers_hash_bucket/max_size" directives.
Vladimir Homutov <vl@nginx.com>
parents: 790
diff changeset
696 Sets the bucket <value>size</value> for hash tables
9e5847af3b2d Documented the "proxy_headers_hash_bucket/max_size" directives.
Vladimir Homutov <vl@nginx.com>
parents: 790
diff changeset
697 used by the <link id="proxy_hide_header"/> and <link id="proxy_set_header"/>
9e5847af3b2d Documented the "proxy_headers_hash_bucket/max_size" directives.
Vladimir Homutov <vl@nginx.com>
parents: 790
diff changeset
698 directives.
959
fbb4cc6f8c3d Text review of ngx_http_proxy_module.
Egor Nikitin <yegor.nikitin@gmail.com>
parents: 942
diff changeset
699 The details of setting up hash tables are provided in a separate
799
9e5847af3b2d Documented the "proxy_headers_hash_bucket/max_size" directives.
Vladimir Homutov <vl@nginx.com>
parents: 790
diff changeset
700 <link doc="../hash.xml">document</link>.
9e5847af3b2d Documented the "proxy_headers_hash_bucket/max_size" directives.
Vladimir Homutov <vl@nginx.com>
parents: 790
diff changeset
701 </para>
9e5847af3b2d Documented the "proxy_headers_hash_bucket/max_size" directives.
Vladimir Homutov <vl@nginx.com>
parents: 790
diff changeset
702
9e5847af3b2d Documented the "proxy_headers_hash_bucket/max_size" directives.
Vladimir Homutov <vl@nginx.com>
parents: 790
diff changeset
703 </directive>
9e5847af3b2d Documented the "proxy_headers_hash_bucket/max_size" directives.
Vladimir Homutov <vl@nginx.com>
parents: 790
diff changeset
704
9e5847af3b2d Documented the "proxy_headers_hash_bucket/max_size" directives.
Vladimir Homutov <vl@nginx.com>
parents: 790
diff changeset
705
9e5847af3b2d Documented the "proxy_headers_hash_bucket/max_size" directives.
Vladimir Homutov <vl@nginx.com>
parents: 790
diff changeset
706 <directive name="proxy_headers_hash_max_size">
9e5847af3b2d Documented the "proxy_headers_hash_bucket/max_size" directives.
Vladimir Homutov <vl@nginx.com>
parents: 790
diff changeset
707 <syntax><value>size</value></syntax>
9e5847af3b2d Documented the "proxy_headers_hash_bucket/max_size" directives.
Vladimir Homutov <vl@nginx.com>
parents: 790
diff changeset
708 <default>512</default>
9e5847af3b2d Documented the "proxy_headers_hash_bucket/max_size" directives.
Vladimir Homutov <vl@nginx.com>
parents: 790
diff changeset
709 <context>http</context>
9e5847af3b2d Documented the "proxy_headers_hash_bucket/max_size" directives.
Vladimir Homutov <vl@nginx.com>
parents: 790
diff changeset
710 <context>server</context>
9e5847af3b2d Documented the "proxy_headers_hash_bucket/max_size" directives.
Vladimir Homutov <vl@nginx.com>
parents: 790
diff changeset
711 <context>location</context>
9e5847af3b2d Documented the "proxy_headers_hash_bucket/max_size" directives.
Vladimir Homutov <vl@nginx.com>
parents: 790
diff changeset
712
9e5847af3b2d Documented the "proxy_headers_hash_bucket/max_size" directives.
Vladimir Homutov <vl@nginx.com>
parents: 790
diff changeset
713 <para>
9e5847af3b2d Documented the "proxy_headers_hash_bucket/max_size" directives.
Vladimir Homutov <vl@nginx.com>
parents: 790
diff changeset
714 Sets the maximum <value>size</value> of hash tables
9e5847af3b2d Documented the "proxy_headers_hash_bucket/max_size" directives.
Vladimir Homutov <vl@nginx.com>
parents: 790
diff changeset
715 used by the <link id="proxy_hide_header"/> and <link id="proxy_set_header"/>
9e5847af3b2d Documented the "proxy_headers_hash_bucket/max_size" directives.
Vladimir Homutov <vl@nginx.com>
parents: 790
diff changeset
716 directives.
959
fbb4cc6f8c3d Text review of ngx_http_proxy_module.
Egor Nikitin <yegor.nikitin@gmail.com>
parents: 942
diff changeset
717 The details of setting up hash tables are provided in a separate
799
9e5847af3b2d Documented the "proxy_headers_hash_bucket/max_size" directives.
Vladimir Homutov <vl@nginx.com>
parents: 790
diff changeset
718 <link doc="../hash.xml">document</link>.
9e5847af3b2d Documented the "proxy_headers_hash_bucket/max_size" directives.
Vladimir Homutov <vl@nginx.com>
parents: 790
diff changeset
719 </para>
9e5847af3b2d Documented the "proxy_headers_hash_bucket/max_size" directives.
Vladimir Homutov <vl@nginx.com>
parents: 790
diff changeset
720
9e5847af3b2d Documented the "proxy_headers_hash_bucket/max_size" directives.
Vladimir Homutov <vl@nginx.com>
parents: 790
diff changeset
721 </directive>
9e5847af3b2d Documented the "proxy_headers_hash_bucket/max_size" directives.
Vladimir Homutov <vl@nginx.com>
parents: 790
diff changeset
722
9e5847af3b2d Documented the "proxy_headers_hash_bucket/max_size" directives.
Vladimir Homutov <vl@nginx.com>
parents: 790
diff changeset
723
281
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
724 <directive name="proxy_hide_header">
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
725 <syntax><value>field</value></syntax>
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
726 <default/>
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
727 <context>http</context>
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
728 <context>server</context>
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
729 <context>location</context>
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
730
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
731 <para>
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
732 By default,
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
733 nginx does not pass the header fields <header>Date</header>,
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
734 <header>Server</header>, <header>X-Pad</header>, and
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
735 <header>X-Accel-...</header> from the response of a proxied
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
736 server to a client.
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
737 The <literal>proxy_hide_header</literal> directive sets additional fields
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
738 that will not be passed.
294
9f5ee1c6fca5 Use consistent wording.
Ruslan Ermilov <ru@nginx.com>
parents: 281
diff changeset
739 If, on the contrary, the passing of fields needs to be permitted,
281
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
740 the <link id="proxy_pass_header"/> directive can be used.
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
741 </para>
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
742
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
743 </directive>
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
744
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
745
316
1fb1c077658b Documented the following directives: "keepalive", "proxy_http_version",
Ruslan Ermilov <ru@nginx.com>
parents: 310
diff changeset
746 <directive name="proxy_http_version">
1fb1c077658b Documented the following directives: "keepalive", "proxy_http_version",
Ruslan Ermilov <ru@nginx.com>
parents: 310
diff changeset
747 <syntax><literal>1.0</literal> | <literal>1.1</literal></syntax>
1fb1c077658b Documented the following directives: "keepalive", "proxy_http_version",
Ruslan Ermilov <ru@nginx.com>
parents: 310
diff changeset
748 <default>1.0</default>
1fb1c077658b Documented the following directives: "keepalive", "proxy_http_version",
Ruslan Ermilov <ru@nginx.com>
parents: 310
diff changeset
749 <context>http</context>
1fb1c077658b Documented the following directives: "keepalive", "proxy_http_version",
Ruslan Ermilov <ru@nginx.com>
parents: 310
diff changeset
750 <context>server</context>
1fb1c077658b Documented the following directives: "keepalive", "proxy_http_version",
Ruslan Ermilov <ru@nginx.com>
parents: 310
diff changeset
751 <context>location</context>
1fb1c077658b Documented the following directives: "keepalive", "proxy_http_version",
Ruslan Ermilov <ru@nginx.com>
parents: 310
diff changeset
752 <appeared-in>1.1.4</appeared-in>
1fb1c077658b Documented the following directives: "keepalive", "proxy_http_version",
Ruslan Ermilov <ru@nginx.com>
parents: 310
diff changeset
753
1fb1c077658b Documented the following directives: "keepalive", "proxy_http_version",
Ruslan Ermilov <ru@nginx.com>
parents: 310
diff changeset
754 <para>
1fb1c077658b Documented the following directives: "keepalive", "proxy_http_version",
Ruslan Ermilov <ru@nginx.com>
parents: 310
diff changeset
755 Sets the HTTP protocol version for proxying.
1fb1c077658b Documented the following directives: "keepalive", "proxy_http_version",
Ruslan Ermilov <ru@nginx.com>
parents: 310
diff changeset
756 By default, version 1.0 is used.
1fb1c077658b Documented the following directives: "keepalive", "proxy_http_version",
Ruslan Ermilov <ru@nginx.com>
parents: 310
diff changeset
757 Version 1.1 is recommended for use with
1fb1c077658b Documented the following directives: "keepalive", "proxy_http_version",
Ruslan Ermilov <ru@nginx.com>
parents: 310
diff changeset
758 <link doc="ngx_http_upstream_module.xml" id="keepalive"/>
1fb1c077658b Documented the following directives: "keepalive", "proxy_http_version",
Ruslan Ermilov <ru@nginx.com>
parents: 310
diff changeset
759 connections.
1fb1c077658b Documented the following directives: "keepalive", "proxy_http_version",
Ruslan Ermilov <ru@nginx.com>
parents: 310
diff changeset
760 </para>
1fb1c077658b Documented the following directives: "keepalive", "proxy_http_version",
Ruslan Ermilov <ru@nginx.com>
parents: 310
diff changeset
761
1fb1c077658b Documented the following directives: "keepalive", "proxy_http_version",
Ruslan Ermilov <ru@nginx.com>
parents: 310
diff changeset
762 </directive>
1fb1c077658b Documented the following directives: "keepalive", "proxy_http_version",
Ruslan Ermilov <ru@nginx.com>
parents: 310
diff changeset
763
1fb1c077658b Documented the following directives: "keepalive", "proxy_http_version",
Ruslan Ermilov <ru@nginx.com>
parents: 310
diff changeset
764
281
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
765 <directive name="proxy_ignore_client_abort">
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
766 <syntax><literal>on</literal> | <literal>off</literal></syntax>
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
767 <default>off</default>
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
768 <context>http</context>
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
769 <context>server</context>
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
770 <context>location</context>
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
771
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
772 <para>
959
fbb4cc6f8c3d Text review of ngx_http_proxy_module.
Egor Nikitin <yegor.nikitin@gmail.com>
parents: 942
diff changeset
773 Determines whether the connection with a proxied server should be
fbb4cc6f8c3d Text review of ngx_http_proxy_module.
Egor Nikitin <yegor.nikitin@gmail.com>
parents: 942
diff changeset
774 closed when a client closes a connection without waiting
294
9f5ee1c6fca5 Use consistent wording.
Ruslan Ermilov <ru@nginx.com>
parents: 281
diff changeset
775 for a response.
281
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
776 </para>
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
777
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
778 </directive>
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
779
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
780
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
781 <directive name="proxy_ignore_headers">
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
782 <syntax><value>field</value> ...</syntax>
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
783 <default/>
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
784 <context>http</context>
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
785 <context>server</context>
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
786 <context>location</context>
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
787
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
788 <para>
294
9f5ee1c6fca5 Use consistent wording.
Ruslan Ermilov <ru@nginx.com>
parents: 281
diff changeset
789 Disables processing of certain response header fields from the proxied server.
281
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
790 The following fields can be ignored: <header>X-Accel-Redirect</header>,
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
791 <header>X-Accel-Expires</header>, <header>X-Accel-Limit-Rate</header> (1.1.6),
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
792 <header>X-Accel-Buffering</header> (1.1.6),
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
793 <header>X-Accel-Charset</header> (1.1.6), <header>Expires</header>,
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
794 <header>Cache-Control</header>, and <header>Set-Cookie</header> (0.8.44).
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
795 </para>
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
796
506
657848837328 Documented how nginx processes proxied server's response header fields
Ruslan Ermilov <ru@nginx.com>
parents: 504
diff changeset
797 <para>
959
fbb4cc6f8c3d Text review of ngx_http_proxy_module.
Egor Nikitin <yegor.nikitin@gmail.com>
parents: 942
diff changeset
798 If not disabled, processing of these header fields has the following
fbb4cc6f8c3d Text review of ngx_http_proxy_module.
Egor Nikitin <yegor.nikitin@gmail.com>
parents: 942
diff changeset
799 effect:
506
657848837328 Documented how nginx processes proxied server's response header fields
Ruslan Ermilov <ru@nginx.com>
parents: 504
diff changeset
800 <list type="bullet" compact="no">
657848837328 Documented how nginx processes proxied server's response header fields
Ruslan Ermilov <ru@nginx.com>
parents: 504
diff changeset
801
657848837328 Documented how nginx processes proxied server's response header fields
Ruslan Ermilov <ru@nginx.com>
parents: 504
diff changeset
802 <listitem>
657848837328 Documented how nginx processes proxied server's response header fields
Ruslan Ermilov <ru@nginx.com>
parents: 504
diff changeset
803 <header>X-Accel-Expires</header>, <header>Expires</header>,
657848837328 Documented how nginx processes proxied server's response header fields
Ruslan Ermilov <ru@nginx.com>
parents: 504
diff changeset
804 <header>Cache-Control</header>, and <header>Set-Cookie</header>
959
fbb4cc6f8c3d Text review of ngx_http_proxy_module.
Egor Nikitin <yegor.nikitin@gmail.com>
parents: 942
diff changeset
805 set the parameters of response <link id="proxy_cache_valid">caching</link>;
506
657848837328 Documented how nginx processes proxied server's response header fields
Ruslan Ermilov <ru@nginx.com>
parents: 504
diff changeset
806 </listitem>
657848837328 Documented how nginx processes proxied server's response header fields
Ruslan Ermilov <ru@nginx.com>
parents: 504
diff changeset
807
657848837328 Documented how nginx processes proxied server's response header fields
Ruslan Ermilov <ru@nginx.com>
parents: 504
diff changeset
808 <listitem>
657848837328 Documented how nginx processes proxied server's response header fields
Ruslan Ermilov <ru@nginx.com>
parents: 504
diff changeset
809 <header>X-Accel-Redirect</header> performs an
657848837328 Documented how nginx processes proxied server's response header fields
Ruslan Ermilov <ru@nginx.com>
parents: 504
diff changeset
810 <link doc="ngx_http_core_module.xml" id="internal">internal
657848837328 Documented how nginx processes proxied server's response header fields
Ruslan Ermilov <ru@nginx.com>
parents: 504
diff changeset
811 redirect</link> to the specified URI;
657848837328 Documented how nginx processes proxied server's response header fields
Ruslan Ermilov <ru@nginx.com>
parents: 504
diff changeset
812 </listitem>
657848837328 Documented how nginx processes proxied server's response header fields
Ruslan Ermilov <ru@nginx.com>
parents: 504
diff changeset
813
657848837328 Documented how nginx processes proxied server's response header fields
Ruslan Ermilov <ru@nginx.com>
parents: 504
diff changeset
814 <listitem>
959
fbb4cc6f8c3d Text review of ngx_http_proxy_module.
Egor Nikitin <yegor.nikitin@gmail.com>
parents: 942
diff changeset
815 <header>X-Accel-Limit-Rate</header> sets the
506
657848837328 Documented how nginx processes proxied server's response header fields
Ruslan Ermilov <ru@nginx.com>
parents: 504
diff changeset
816 <link doc="ngx_http_core_module.xml" id="limit_rate">rate
657848837328 Documented how nginx processes proxied server's response header fields
Ruslan Ermilov <ru@nginx.com>
parents: 504
diff changeset
817 limit</link> for transmission of a response to a client;
657848837328 Documented how nginx processes proxied server's response header fields
Ruslan Ermilov <ru@nginx.com>
parents: 504
diff changeset
818 </listitem>
657848837328 Documented how nginx processes proxied server's response header fields
Ruslan Ermilov <ru@nginx.com>
parents: 504
diff changeset
819
657848837328 Documented how nginx processes proxied server's response header fields
Ruslan Ermilov <ru@nginx.com>
parents: 504
diff changeset
820 <listitem>
657848837328 Documented how nginx processes proxied server's response header fields
Ruslan Ermilov <ru@nginx.com>
parents: 504
diff changeset
821 <header>X-Accel-Buffering</header> enables or disables
657848837328 Documented how nginx processes proxied server's response header fields
Ruslan Ermilov <ru@nginx.com>
parents: 504
diff changeset
822 <link id="proxy_buffering">buffering</link> of a response;
657848837328 Documented how nginx processes proxied server's response header fields
Ruslan Ermilov <ru@nginx.com>
parents: 504
diff changeset
823 </listitem>
657848837328 Documented how nginx processes proxied server's response header fields
Ruslan Ermilov <ru@nginx.com>
parents: 504
diff changeset
824
657848837328 Documented how nginx processes proxied server's response header fields
Ruslan Ermilov <ru@nginx.com>
parents: 504
diff changeset
825 <listitem>
657848837328 Documented how nginx processes proxied server's response header fields
Ruslan Ermilov <ru@nginx.com>
parents: 504
diff changeset
826 <header>X-Accel-Charset</header> sets the desired
657848837328 Documented how nginx processes proxied server's response header fields
Ruslan Ermilov <ru@nginx.com>
parents: 504
diff changeset
827 <link doc="ngx_http_charset_module.xml" id="charset"/>
657848837328 Documented how nginx processes proxied server's response header fields
Ruslan Ermilov <ru@nginx.com>
parents: 504
diff changeset
828 of a response.
657848837328 Documented how nginx processes proxied server's response header fields
Ruslan Ermilov <ru@nginx.com>
parents: 504
diff changeset
829 </listitem>
657848837328 Documented how nginx processes proxied server's response header fields
Ruslan Ermilov <ru@nginx.com>
parents: 504
diff changeset
830
657848837328 Documented how nginx processes proxied server's response header fields
Ruslan Ermilov <ru@nginx.com>
parents: 504
diff changeset
831 </list>
657848837328 Documented how nginx processes proxied server's response header fields
Ruslan Ermilov <ru@nginx.com>
parents: 504
diff changeset
832 </para>
657848837328 Documented how nginx processes proxied server's response header fields
Ruslan Ermilov <ru@nginx.com>
parents: 504
diff changeset
833
281
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
834 </directive>
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
835
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
836
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
837 <directive name="proxy_intercept_errors">
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
838 <syntax><literal>on</literal> | <literal>off</literal></syntax>
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
839 <default>off</default>
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
840 <context>http</context>
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
841 <context>server</context>
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
842 <context>location</context>
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
843
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
844 <para>
297
94c8df379088 Added missing word.
Ruslan Ermilov <ru@nginx.com>
parents: 294
diff changeset
845 Determines whether proxied responses with codes greater than or equal
907
43887f41bb17 Corrected the descriptions of {proxy,fastcgi}_intercept_errors.
Ruslan Ermilov <ru@nginx.com>
parents: 849
diff changeset
846 to 300 should be passed to a client or be redirected to nginx for processing
966
95c3c3bbf1ce Text review.
Egor Nikitin <yegor.nikitin@gmail.com>
parents: 959
diff changeset
847 with the <link doc="ngx_http_core_module.xml" id="error_page"/> directive.
281
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
848 </para>
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
849
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
850 </directive>
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
851
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
852
405
781b23ba3b0a Documented the following directives: proxy_busy_buffers_size,
Ruslan Ermilov <ru@nginx.com>
parents: 364
diff changeset
853 <directive name="proxy_max_temp_file_size">
781b23ba3b0a Documented the following directives: proxy_busy_buffers_size,
Ruslan Ermilov <ru@nginx.com>
parents: 364
diff changeset
854 <syntax><value>size</value></syntax>
781b23ba3b0a Documented the following directives: proxy_busy_buffers_size,
Ruslan Ermilov <ru@nginx.com>
parents: 364
diff changeset
855 <default>1024m</default>
781b23ba3b0a Documented the following directives: proxy_busy_buffers_size,
Ruslan Ermilov <ru@nginx.com>
parents: 364
diff changeset
856 <context>http</context>
781b23ba3b0a Documented the following directives: proxy_busy_buffers_size,
Ruslan Ermilov <ru@nginx.com>
parents: 364
diff changeset
857 <context>server</context>
781b23ba3b0a Documented the following directives: proxy_busy_buffers_size,
Ruslan Ermilov <ru@nginx.com>
parents: 364
diff changeset
858 <context>location</context>
781b23ba3b0a Documented the following directives: proxy_busy_buffers_size,
Ruslan Ermilov <ru@nginx.com>
parents: 364
diff changeset
859
781b23ba3b0a Documented the following directives: proxy_busy_buffers_size,
Ruslan Ermilov <ru@nginx.com>
parents: 364
diff changeset
860 <para>
781b23ba3b0a Documented the following directives: proxy_busy_buffers_size,
Ruslan Ermilov <ru@nginx.com>
parents: 364
diff changeset
861 When <link id="proxy_buffering">buffering</link> of responses from the proxied
959
fbb4cc6f8c3d Text review of ngx_http_proxy_module.
Egor Nikitin <yegor.nikitin@gmail.com>
parents: 942
diff changeset
862 server is enabled, and the whole response does not fit into the memory buffers
405
781b23ba3b0a Documented the following directives: proxy_busy_buffers_size,
Ruslan Ermilov <ru@nginx.com>
parents: 364
diff changeset
863 set by the <link id="proxy_buffer_size"/> and <link id="proxy_buffers"/>
966
95c3c3bbf1ce Text review.
Egor Nikitin <yegor.nikitin@gmail.com>
parents: 959
diff changeset
864 directives, a part of the response can be saved to a temporary file.
405
781b23ba3b0a Documented the following directives: proxy_busy_buffers_size,
Ruslan Ermilov <ru@nginx.com>
parents: 364
diff changeset
865 This directive sets the maximum <value>size</value> of a temporary file.
781b23ba3b0a Documented the following directives: proxy_busy_buffers_size,
Ruslan Ermilov <ru@nginx.com>
parents: 364
diff changeset
866 The size of data written to a temporary file at a time is set
781b23ba3b0a Documented the following directives: proxy_busy_buffers_size,
Ruslan Ermilov <ru@nginx.com>
parents: 364
diff changeset
867 by the <link id="proxy_temp_file_write_size"/> directive.
781b23ba3b0a Documented the following directives: proxy_busy_buffers_size,
Ruslan Ermilov <ru@nginx.com>
parents: 364
diff changeset
868 </para>
781b23ba3b0a Documented the following directives: proxy_busy_buffers_size,
Ruslan Ermilov <ru@nginx.com>
parents: 364
diff changeset
869
781b23ba3b0a Documented the following directives: proxy_busy_buffers_size,
Ruslan Ermilov <ru@nginx.com>
parents: 364
diff changeset
870 <para>
959
fbb4cc6f8c3d Text review of ngx_http_proxy_module.
Egor Nikitin <yegor.nikitin@gmail.com>
parents: 942
diff changeset
871 The zero value disables buffering of responses to temporary files.
405
781b23ba3b0a Documented the following directives: proxy_busy_buffers_size,
Ruslan Ermilov <ru@nginx.com>
parents: 364
diff changeset
872 </para>
781b23ba3b0a Documented the following directives: proxy_busy_buffers_size,
Ruslan Ermilov <ru@nginx.com>
parents: 364
diff changeset
873
781b23ba3b0a Documented the following directives: proxy_busy_buffers_size,
Ruslan Ermilov <ru@nginx.com>
parents: 364
diff changeset
874 </directive>
781b23ba3b0a Documented the following directives: proxy_busy_buffers_size,
Ruslan Ermilov <ru@nginx.com>
parents: 364
diff changeset
875
781b23ba3b0a Documented the following directives: proxy_busy_buffers_size,
Ruslan Ermilov <ru@nginx.com>
parents: 364
diff changeset
876
787
180a64c709d8 Documented "proxy_set_body" and "proxy_method" directives.
Vladimir Homutov <vl@nginx.com>
parents: 773
diff changeset
877 <directive name="proxy_method">
180a64c709d8 Documented "proxy_set_body" and "proxy_method" directives.
Vladimir Homutov <vl@nginx.com>
parents: 773
diff changeset
878 <syntax><value>method</value></syntax>
180a64c709d8 Documented "proxy_set_body" and "proxy_method" directives.
Vladimir Homutov <vl@nginx.com>
parents: 773
diff changeset
879 <default/>
180a64c709d8 Documented "proxy_set_body" and "proxy_method" directives.
Vladimir Homutov <vl@nginx.com>
parents: 773
diff changeset
880 <context>http</context>
180a64c709d8 Documented "proxy_set_body" and "proxy_method" directives.
Vladimir Homutov <vl@nginx.com>
parents: 773
diff changeset
881 <context>server</context>
180a64c709d8 Documented "proxy_set_body" and "proxy_method" directives.
Vladimir Homutov <vl@nginx.com>
parents: 773
diff changeset
882 <context>location</context>
180a64c709d8 Documented "proxy_set_body" and "proxy_method" directives.
Vladimir Homutov <vl@nginx.com>
parents: 773
diff changeset
883
180a64c709d8 Documented "proxy_set_body" and "proxy_method" directives.
Vladimir Homutov <vl@nginx.com>
parents: 773
diff changeset
884 <para>
180a64c709d8 Documented "proxy_set_body" and "proxy_method" directives.
Vladimir Homutov <vl@nginx.com>
parents: 773
diff changeset
885 Specifies the HTTP <value>method</value> to use in requests forwarded
180a64c709d8 Documented "proxy_set_body" and "proxy_method" directives.
Vladimir Homutov <vl@nginx.com>
parents: 773
diff changeset
886 to the proxied server instead of the method from the client request.
180a64c709d8 Documented "proxy_set_body" and "proxy_method" directives.
Vladimir Homutov <vl@nginx.com>
parents: 773
diff changeset
887 </para>
180a64c709d8 Documented "proxy_set_body" and "proxy_method" directives.
Vladimir Homutov <vl@nginx.com>
parents: 773
diff changeset
888
180a64c709d8 Documented "proxy_set_body" and "proxy_method" directives.
Vladimir Homutov <vl@nginx.com>
parents: 773
diff changeset
889 </directive>
180a64c709d8 Documented "proxy_set_body" and "proxy_method" directives.
Vladimir Homutov <vl@nginx.com>
parents: 773
diff changeset
890
180a64c709d8 Documented "proxy_set_body" and "proxy_method" directives.
Vladimir Homutov <vl@nginx.com>
parents: 773
diff changeset
891
281
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
892 <directive name="proxy_next_upstream">
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
893 <syntax>
364
bb51d3e17dd0 Style fixed.
Ruslan Ermilov <ru@nginx.com>
parents: 362
diff changeset
894 <literal>error</literal> |
bb51d3e17dd0 Style fixed.
Ruslan Ermilov <ru@nginx.com>
parents: 362
diff changeset
895 <literal>timeout</literal> |
bb51d3e17dd0 Style fixed.
Ruslan Ermilov <ru@nginx.com>
parents: 362
diff changeset
896 <literal>invalid_header</literal> |
bb51d3e17dd0 Style fixed.
Ruslan Ermilov <ru@nginx.com>
parents: 362
diff changeset
897 <literal>http_500</literal> |
bb51d3e17dd0 Style fixed.
Ruslan Ermilov <ru@nginx.com>
parents: 362
diff changeset
898 <literal>http_502</literal> |
bb51d3e17dd0 Style fixed.
Ruslan Ermilov <ru@nginx.com>
parents: 362
diff changeset
899 <literal>http_503</literal> |
bb51d3e17dd0 Style fixed.
Ruslan Ermilov <ru@nginx.com>
parents: 362
diff changeset
900 <literal>http_504</literal> |
917
e26a18eb5ccd Documented http_403 in proxy_next_upstream and friends.
Maxim Dounin <mdounin@mdounin.ru>
parents: 907
diff changeset
901 <literal>http_403</literal> |
364
bb51d3e17dd0 Style fixed.
Ruslan Ermilov <ru@nginx.com>
parents: 362
diff changeset
902 <literal>http_404</literal> |
bb51d3e17dd0 Style fixed.
Ruslan Ermilov <ru@nginx.com>
parents: 362
diff changeset
903 <literal>off</literal>
bb51d3e17dd0 Style fixed.
Ruslan Ermilov <ru@nginx.com>
parents: 362
diff changeset
904 ...</syntax>
281
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
905 <default>error timeout</default>
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
906 <context>http</context>
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
907 <context>server</context>
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
908 <context>location</context>
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
909
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
910 <para>
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
911 Specifies in which cases a request should be passed to the next server:
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
912 <list type="tag">
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
913
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
914 <tag-name><literal>error</literal></tag-name>
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
915 <tag-desc>an error occurred while establishing a connection with the
959
fbb4cc6f8c3d Text review of ngx_http_proxy_module.
Egor Nikitin <yegor.nikitin@gmail.com>
parents: 942
diff changeset
916 server, passing a request to it, or reading the response header;</tag-desc>
281
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
917
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
918 <tag-name><literal>timeout</literal></tag-name>
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
919 <tag-desc>a timeout has occurred while establishing a connection with the
959
fbb4cc6f8c3d Text review of ngx_http_proxy_module.
Egor Nikitin <yegor.nikitin@gmail.com>
parents: 942
diff changeset
920 server, passing a request to it, or reading the response header;</tag-desc>
281
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
921
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
922 <tag-name><literal>invalid_header</literal></tag-name>
959
fbb4cc6f8c3d Text review of ngx_http_proxy_module.
Egor Nikitin <yegor.nikitin@gmail.com>
parents: 942
diff changeset
923 <tag-desc>a server returned an empty or invalid response;</tag-desc>
281
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
924
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
925 <tag-name><literal>http_500</literal></tag-name>
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
926 <tag-desc>a server returned a response with the code 500;</tag-desc>
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
927
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
928 <tag-name><literal>http_502</literal></tag-name>
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
929 <tag-desc>a server returned a response with the code 502;</tag-desc>
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
930
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
931 <tag-name><literal>http_503</literal></tag-name>
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
932 <tag-desc>a server returned a response with the code 503;</tag-desc>
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
933
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
934 <tag-name><literal>http_504</literal></tag-name>
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
935 <tag-desc>a server returned a response with the code 504;</tag-desc>
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
936
917
e26a18eb5ccd Documented http_403 in proxy_next_upstream and friends.
Maxim Dounin <mdounin@mdounin.ru>
parents: 907
diff changeset
937 <tag-name><literal>http_403</literal></tag-name>
e26a18eb5ccd Documented http_403 in proxy_next_upstream and friends.
Maxim Dounin <mdounin@mdounin.ru>
parents: 907
diff changeset
938 <tag-desc>a server returned a response with the code 403;</tag-desc>
e26a18eb5ccd Documented http_403 in proxy_next_upstream and friends.
Maxim Dounin <mdounin@mdounin.ru>
parents: 907
diff changeset
939
281
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
940 <tag-name><literal>http_404</literal></tag-name>
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
941 <tag-desc>a server returned a response with the code 404;</tag-desc>
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
942
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
943 <tag-name><literal>off</literal></tag-name>
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
944 <tag-desc>disables passing a request to the next server.</tag-desc>
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
945
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
946 </list>
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
947 </para>
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
948
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
949 <para>
959
fbb4cc6f8c3d Text review of ngx_http_proxy_module.
Egor Nikitin <yegor.nikitin@gmail.com>
parents: 942
diff changeset
950 One should bear in mind that passing a request to the next server is
fbb4cc6f8c3d Text review of ngx_http_proxy_module.
Egor Nikitin <yegor.nikitin@gmail.com>
parents: 942
diff changeset
951 only possible if nothing has been sent to a client yet.
fbb4cc6f8c3d Text review of ngx_http_proxy_module.
Egor Nikitin <yegor.nikitin@gmail.com>
parents: 942
diff changeset
952 That is, if an error or timeout occurs in the middle of the
fbb4cc6f8c3d Text review of ngx_http_proxy_module.
Egor Nikitin <yegor.nikitin@gmail.com>
parents: 942
diff changeset
953 transferring of a response, fixing this is impossible.
281
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
954 </para>
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
955
942
ba3d6ade3513 Elaborate on upstream server failures.
Ruslan Ermilov <ru@nginx.com>
parents: 917
diff changeset
956 <para>
ba3d6ade3513 Elaborate on upstream server failures.
Ruslan Ermilov <ru@nginx.com>
parents: 917
diff changeset
957 The directive also defines what is considered an unsuccessful attempt
ba3d6ade3513 Elaborate on upstream server failures.
Ruslan Ermilov <ru@nginx.com>
parents: 917
diff changeset
958 of communication with a
ba3d6ade3513 Elaborate on upstream server failures.
Ruslan Ermilov <ru@nginx.com>
parents: 917
diff changeset
959 <link doc="ngx_http_upstream_module.xml" id="server"/>.
ba3d6ade3513 Elaborate on upstream server failures.
Ruslan Ermilov <ru@nginx.com>
parents: 917
diff changeset
960 The cases of <literal>error</literal>, <literal>timeout</literal> and
ba3d6ade3513 Elaborate on upstream server failures.
Ruslan Ermilov <ru@nginx.com>
parents: 917
diff changeset
961 <literal>invalid_header</literal> are always considered unsuccessful attempts,
ba3d6ade3513 Elaborate on upstream server failures.
Ruslan Ermilov <ru@nginx.com>
parents: 917
diff changeset
962 even if they are not specified in the directive.
ba3d6ade3513 Elaborate on upstream server failures.
Ruslan Ermilov <ru@nginx.com>
parents: 917
diff changeset
963 The cases of <literal>http_500</literal>, <literal>http_502</literal>,
ba3d6ade3513 Elaborate on upstream server failures.
Ruslan Ermilov <ru@nginx.com>
parents: 917
diff changeset
964 <literal>http_503</literal> and <literal>http_504</literal> are
ba3d6ade3513 Elaborate on upstream server failures.
Ruslan Ermilov <ru@nginx.com>
parents: 917
diff changeset
965 considered unsuccessful attempts only if they are specified in the directive.
ba3d6ade3513 Elaborate on upstream server failures.
Ruslan Ermilov <ru@nginx.com>
parents: 917
diff changeset
966 The cases of <literal>http_403</literal> and <literal>http_404</literal>
ba3d6ade3513 Elaborate on upstream server failures.
Ruslan Ermilov <ru@nginx.com>
parents: 917
diff changeset
967 are never considered unsuccessful attempts.
ba3d6ade3513 Elaborate on upstream server failures.
Ruslan Ermilov <ru@nginx.com>
parents: 917
diff changeset
968 </para>
ba3d6ade3513 Elaborate on upstream server failures.
Ruslan Ermilov <ru@nginx.com>
parents: 917
diff changeset
969
281
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
970 </directive>
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
971
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
972
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
973 <directive name="proxy_no_cache">
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
974 <syntax><value>string</value> ...</syntax>
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
975 <default/>
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
976 <context>http</context>
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
977 <context>server</context>
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
978 <context>location</context>
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
979
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
980 <para>
294
9f5ee1c6fca5 Use consistent wording.
Ruslan Ermilov <ru@nginx.com>
parents: 281
diff changeset
981 Defines conditions under which the response will not be saved to a cache.
281
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
982 If at least one value of the string parameters is not empty and is not
294
9f5ee1c6fca5 Use consistent wording.
Ruslan Ermilov <ru@nginx.com>
parents: 281
diff changeset
983 equal to “0” then the response will not be saved:
281
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
984 <example>
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
985 proxy_no_cache $cookie_nocache $arg_nocache$arg_comment;
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
986 proxy_no_cache $http_pragma $http_authorization;
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
987 </example>
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
988 Can be used along with the <link id="proxy_cache_bypass"/> directive.
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
989 </para>
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
990
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
991 </directive>
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
992
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
993
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
994 <directive name="proxy_pass">
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
995 <syntax><value>URL</value></syntax>
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
996 <default/>
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
997 <context>location</context>
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
998 <context>if in location</context>
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
999 <context>limit_except</context>
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
1000
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
1001 <para>
959
fbb4cc6f8c3d Text review of ngx_http_proxy_module.
Egor Nikitin <yegor.nikitin@gmail.com>
parents: 942
diff changeset
1002 Sets the protocol and address of a proxied server and an optional URI
535
f8652d663b62 Revised description of "proxy_pass".
Ruslan Ermilov <ru@nginx.com>
parents: 508
diff changeset
1003 to which a location should be mapped.
959
fbb4cc6f8c3d Text review of ngx_http_proxy_module.
Egor Nikitin <yegor.nikitin@gmail.com>
parents: 942
diff changeset
1004 As a protocol, “<literal>http</literal>” or “<literal>https</literal>”
fbb4cc6f8c3d Text review of ngx_http_proxy_module.
Egor Nikitin <yegor.nikitin@gmail.com>
parents: 942
diff changeset
1005 can be specified.
fbb4cc6f8c3d Text review of ngx_http_proxy_module.
Egor Nikitin <yegor.nikitin@gmail.com>
parents: 942
diff changeset
1006 The address can be specified as a domain name or IP address,
535
f8652d663b62 Revised description of "proxy_pass".
Ruslan Ermilov <ru@nginx.com>
parents: 508
diff changeset
1007 and an optional port:
281
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
1008 <example>
351
a4fa80755eab Consistently strip initial offset in examples.
Ruslan Ermilov <ru@nginx.com>
parents: 316
diff changeset
1009 proxy_pass http://localhost:8000/uri/;
281
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
1010 </example>
535
f8652d663b62 Revised description of "proxy_pass".
Ruslan Ermilov <ru@nginx.com>
parents: 508
diff changeset
1011 or as a UNIX-domain socket path specified after the word
f8652d663b62 Revised description of "proxy_pass".
Ruslan Ermilov <ru@nginx.com>
parents: 508
diff changeset
1012 “<literal>unix</literal>” and enclosed in colons:
281
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
1013 <example>
351
a4fa80755eab Consistently strip initial offset in examples.
Ruslan Ermilov <ru@nginx.com>
parents: 316
diff changeset
1014 proxy_pass http://unix:/tmp/backend.socket:/uri/;
281
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
1015 </example>
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
1016 </para>
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
1017
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
1018 <para>
294
9f5ee1c6fca5 Use consistent wording.
Ruslan Ermilov <ru@nginx.com>
parents: 281
diff changeset
1019 If a domain name resolves to several addresses, all of them will be
281
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
1020 used in a round-robin fashion.
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
1021 In addition, an address can be specified as a
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
1022 <link doc="ngx_http_upstream_module.xml">server group</link>.
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
1023 </para>
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
1024
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
1025 <para>
535
f8652d663b62 Revised description of "proxy_pass".
Ruslan Ermilov <ru@nginx.com>
parents: 508
diff changeset
1026 A request URI is passed to the server as follows:
f8652d663b62 Revised description of "proxy_pass".
Ruslan Ermilov <ru@nginx.com>
parents: 508
diff changeset
1027 <list type="bullet" compact="no">
281
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
1028
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
1029 <listitem>
959
fbb4cc6f8c3d Text review of ngx_http_proxy_module.
Egor Nikitin <yegor.nikitin@gmail.com>
parents: 942
diff changeset
1030 If the <literal>proxy_pass</literal> directive is specified with a URI,
fbb4cc6f8c3d Text review of ngx_http_proxy_module.
Egor Nikitin <yegor.nikitin@gmail.com>
parents: 942
diff changeset
1031 then when a request is passed to the server, the part of a
535
f8652d663b62 Revised description of "proxy_pass".
Ruslan Ermilov <ru@nginx.com>
parents: 508
diff changeset
1032 <link doc="ngx_http_core_module.xml" id="location">normalized</link>
f8652d663b62 Revised description of "proxy_pass".
Ruslan Ermilov <ru@nginx.com>
parents: 508
diff changeset
1033 request URI matching the location is replaced by a URI
f8652d663b62 Revised description of "proxy_pass".
Ruslan Ermilov <ru@nginx.com>
parents: 508
diff changeset
1034 specified in the directive:
f8652d663b62 Revised description of "proxy_pass".
Ruslan Ermilov <ru@nginx.com>
parents: 508
diff changeset
1035 <example>
f8652d663b62 Revised description of "proxy_pass".
Ruslan Ermilov <ru@nginx.com>
parents: 508
diff changeset
1036 location /name/ {
f8652d663b62 Revised description of "proxy_pass".
Ruslan Ermilov <ru@nginx.com>
parents: 508
diff changeset
1037 proxy_pass http://127.0.0.1/remote/;
f8652d663b62 Revised description of "proxy_pass".
Ruslan Ermilov <ru@nginx.com>
parents: 508
diff changeset
1038 }
f8652d663b62 Revised description of "proxy_pass".
Ruslan Ermilov <ru@nginx.com>
parents: 508
diff changeset
1039 </example>
281
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
1040 </listitem>
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
1041
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
1042 <listitem>
959
fbb4cc6f8c3d Text review of ngx_http_proxy_module.
Egor Nikitin <yegor.nikitin@gmail.com>
parents: 942
diff changeset
1043 If <literal>proxy_pass</literal> is specified without a URI,
fbb4cc6f8c3d Text review of ngx_http_proxy_module.
Egor Nikitin <yegor.nikitin@gmail.com>
parents: 942
diff changeset
1044 the request URI is passed to the server in the same form
fbb4cc6f8c3d Text review of ngx_http_proxy_module.
Egor Nikitin <yegor.nikitin@gmail.com>
parents: 942
diff changeset
1045 as sent by a client when the original request is processed,
535
f8652d663b62 Revised description of "proxy_pass".
Ruslan Ermilov <ru@nginx.com>
parents: 508
diff changeset
1046 or the full normalized request URI is passed
f8652d663b62 Revised description of "proxy_pass".
Ruslan Ermilov <ru@nginx.com>
parents: 508
diff changeset
1047 when processing the changed URI:
f8652d663b62 Revised description of "proxy_pass".
Ruslan Ermilov <ru@nginx.com>
parents: 508
diff changeset
1048 <example>
f8652d663b62 Revised description of "proxy_pass".
Ruslan Ermilov <ru@nginx.com>
parents: 508
diff changeset
1049 location /some/path/ {
f8652d663b62 Revised description of "proxy_pass".
Ruslan Ermilov <ru@nginx.com>
parents: 508
diff changeset
1050 proxy_pass http://127.0.0.1;
f8652d663b62 Revised description of "proxy_pass".
Ruslan Ermilov <ru@nginx.com>
parents: 508
diff changeset
1051 }
f8652d663b62 Revised description of "proxy_pass".
Ruslan Ermilov <ru@nginx.com>
parents: 508
diff changeset
1052 </example>
f8652d663b62 Revised description of "proxy_pass".
Ruslan Ermilov <ru@nginx.com>
parents: 508
diff changeset
1053 <note>
f8652d663b62 Revised description of "proxy_pass".
Ruslan Ermilov <ru@nginx.com>
parents: 508
diff changeset
1054 Before version 1.1.12,
f8652d663b62 Revised description of "proxy_pass".
Ruslan Ermilov <ru@nginx.com>
parents: 508
diff changeset
1055 if <literal>proxy_pass</literal> is specified without a URI,
959
fbb4cc6f8c3d Text review of ngx_http_proxy_module.
Egor Nikitin <yegor.nikitin@gmail.com>
parents: 942
diff changeset
1056 the original request URI might be passed
535
f8652d663b62 Revised description of "proxy_pass".
Ruslan Ermilov <ru@nginx.com>
parents: 508
diff changeset
1057 instead of the changed URI in some cases.
f8652d663b62 Revised description of "proxy_pass".
Ruslan Ermilov <ru@nginx.com>
parents: 508
diff changeset
1058 </note>
f8652d663b62 Revised description of "proxy_pass".
Ruslan Ermilov <ru@nginx.com>
parents: 508
diff changeset
1059 </listitem>
f8652d663b62 Revised description of "proxy_pass".
Ruslan Ermilov <ru@nginx.com>
parents: 508
diff changeset
1060 </list>
f8652d663b62 Revised description of "proxy_pass".
Ruslan Ermilov <ru@nginx.com>
parents: 508
diff changeset
1061 </para>
f8652d663b62 Revised description of "proxy_pass".
Ruslan Ermilov <ru@nginx.com>
parents: 508
diff changeset
1062
f8652d663b62 Revised description of "proxy_pass".
Ruslan Ermilov <ru@nginx.com>
parents: 508
diff changeset
1063 <para>
959
fbb4cc6f8c3d Text review of ngx_http_proxy_module.
Egor Nikitin <yegor.nikitin@gmail.com>
parents: 942
diff changeset
1064 In some cases, the part of a request URI to be replaced cannot be determined:
535
f8652d663b62 Revised description of "proxy_pass".
Ruslan Ermilov <ru@nginx.com>
parents: 508
diff changeset
1065 <list type="bullet" compact="no">
f8652d663b62 Revised description of "proxy_pass".
Ruslan Ermilov <ru@nginx.com>
parents: 508
diff changeset
1066
f8652d663b62 Revised description of "proxy_pass".
Ruslan Ermilov <ru@nginx.com>
parents: 508
diff changeset
1067 <listitem>
f8652d663b62 Revised description of "proxy_pass".
Ruslan Ermilov <ru@nginx.com>
parents: 508
diff changeset
1068 When location is specified using a regular expression.
f8652d663b62 Revised description of "proxy_pass".
Ruslan Ermilov <ru@nginx.com>
parents: 508
diff changeset
1069 <para>
959
fbb4cc6f8c3d Text review of ngx_http_proxy_module.
Egor Nikitin <yegor.nikitin@gmail.com>
parents: 942
diff changeset
1070 In this case, the directive should be specified without a URI.
535
f8652d663b62 Revised description of "proxy_pass".
Ruslan Ermilov <ru@nginx.com>
parents: 508
diff changeset
1071 </para>
f8652d663b62 Revised description of "proxy_pass".
Ruslan Ermilov <ru@nginx.com>
parents: 508
diff changeset
1072 </listitem>
f8652d663b62 Revised description of "proxy_pass".
Ruslan Ermilov <ru@nginx.com>
parents: 508
diff changeset
1073
f8652d663b62 Revised description of "proxy_pass".
Ruslan Ermilov <ru@nginx.com>
parents: 508
diff changeset
1074 <listitem>
959
fbb4cc6f8c3d Text review of ngx_http_proxy_module.
Egor Nikitin <yegor.nikitin@gmail.com>
parents: 942
diff changeset
1075 When the URI is changed inside a proxied location using the
535
f8652d663b62 Revised description of "proxy_pass".
Ruslan Ermilov <ru@nginx.com>
parents: 508
diff changeset
1076 <link doc="ngx_http_rewrite_module.xml" id="rewrite"/> directive,
f8652d663b62 Revised description of "proxy_pass".
Ruslan Ermilov <ru@nginx.com>
parents: 508
diff changeset
1077 and this same configuration will be used to process a request
f8652d663b62 Revised description of "proxy_pass".
Ruslan Ermilov <ru@nginx.com>
parents: 508
diff changeset
1078 (<literal>break</literal>):
281
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
1079 <example>
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
1080 location /name/ {
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
1081 rewrite /name/([^/]+) /users?name=$1 break;
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
1082 proxy_pass http://127.0.0.1;
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
1083 }
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
1084 </example>
535
f8652d663b62 Revised description of "proxy_pass".
Ruslan Ermilov <ru@nginx.com>
parents: 508
diff changeset
1085 <para>
959
fbb4cc6f8c3d Text review of ngx_http_proxy_module.
Egor Nikitin <yegor.nikitin@gmail.com>
parents: 942
diff changeset
1086 In this case, the URI specified in the directive is ignored and
535
f8652d663b62 Revised description of "proxy_pass".
Ruslan Ermilov <ru@nginx.com>
parents: 508
diff changeset
1087 the full changed request URI is passed to the server.
f8652d663b62 Revised description of "proxy_pass".
Ruslan Ermilov <ru@nginx.com>
parents: 508
diff changeset
1088 </para>
281
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
1089 </listitem>
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
1090 </list>
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
1091 </para>
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
1092
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
1093 <para>
959
fbb4cc6f8c3d Text review of ngx_http_proxy_module.
Egor Nikitin <yegor.nikitin@gmail.com>
parents: 942
diff changeset
1094 A server name, its port and the passed URI can also be specified using
fbb4cc6f8c3d Text review of ngx_http_proxy_module.
Egor Nikitin <yegor.nikitin@gmail.com>
parents: 942
diff changeset
1095 variables:
281
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
1096 <example>
351
a4fa80755eab Consistently strip initial offset in examples.
Ruslan Ermilov <ru@nginx.com>
parents: 316
diff changeset
1097 proxy_pass http://$host$uri;
281
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
1098 </example>
535
f8652d663b62 Revised description of "proxy_pass".
Ruslan Ermilov <ru@nginx.com>
parents: 508
diff changeset
1099 or even like this:
281
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
1100 <example>
351
a4fa80755eab Consistently strip initial offset in examples.
Ruslan Ermilov <ru@nginx.com>
parents: 316
diff changeset
1101 proxy_pass $request;
281
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
1102 </example>
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
1103 </para>
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
1104
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
1105 <para>
959
fbb4cc6f8c3d Text review of ngx_http_proxy_module.
Egor Nikitin <yegor.nikitin@gmail.com>
parents: 942
diff changeset
1106 In this case, the server name is searched among the described
281
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
1107 <link doc="ngx_http_upstream_module.xml">server groups</link>,
959
fbb4cc6f8c3d Text review of ngx_http_proxy_module.
Egor Nikitin <yegor.nikitin@gmail.com>
parents: 942
diff changeset
1108 and, if not found, is determined using a
281
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
1109 <link doc="ngx_http_core_module.xml" id="resolver"/>.
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
1110 </para>
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
1111
849
0ed4c093c026 WebSocket proxying howto.
Homutov Vladimir <vl@nginx.com>
parents: 815
diff changeset
1112 <para>
0ed4c093c026 WebSocket proxying howto.
Homutov Vladimir <vl@nginx.com>
parents: 815
diff changeset
1113 <link doc="websocket.xml">WebSocket</link> proxying requires special
0ed4c093c026 WebSocket proxying howto.
Homutov Vladimir <vl@nginx.com>
parents: 815
diff changeset
1114 configuration and is supported since version 1.3.13.
0ed4c093c026 WebSocket proxying howto.
Homutov Vladimir <vl@nginx.com>
parents: 815
diff changeset
1115 </para>
0ed4c093c026 WebSocket proxying howto.
Homutov Vladimir <vl@nginx.com>
parents: 815
diff changeset
1116
281
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
1117 </directive>
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
1118
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
1119
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
1120 <directive name="proxy_pass_header">
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
1121 <syntax><value>field</value></syntax>
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
1122 <default/>
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
1123 <context>http</context>
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
1124 <context>server</context>
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
1125 <context>location</context>
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
1126
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
1127 <para>
959
fbb4cc6f8c3d Text review of ngx_http_proxy_module.
Egor Nikitin <yegor.nikitin@gmail.com>
parents: 942
diff changeset
1128 Permits passing <link id="proxy_hide_header">otherwise disabled</link> header
281
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
1129 fields from a proxied server to a client.
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
1130 </para>
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
1131
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
1132 </directive>
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
1133
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
1134
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
1135 <directive name="proxy_read_timeout">
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
1136 <syntax><value>time</value></syntax>
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
1137 <default>60s</default>
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
1138 <context>http</context>
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
1139 <context>server</context>
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
1140 <context>location</context>
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
1141
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
1142 <para>
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
1143 Defines a timeout for reading a response from the proxied server.
966
95c3c3bbf1ce Text review.
Egor Nikitin <yegor.nikitin@gmail.com>
parents: 959
diff changeset
1144 A timeout is set only between two successive read operations,
281
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
1145 not for the transmission of the whole response.
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
1146 If a proxied server does not transmit anything within this time,
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
1147 a connection is closed.
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
1148 </para>
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
1149
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
1150 </directive>
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
1151
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
1152
789
1063836dacea Documented "proxy_pass_request_body/headers" directives.
Vladimir Homutov <vl@nginx.com>
parents: 787
diff changeset
1153 <directive name="proxy_pass_request_body">
1063836dacea Documented "proxy_pass_request_body/headers" directives.
Vladimir Homutov <vl@nginx.com>
parents: 787
diff changeset
1154 <syntax><literal>on</literal> | <literal>off</literal></syntax>
1063836dacea Documented "proxy_pass_request_body/headers" directives.
Vladimir Homutov <vl@nginx.com>
parents: 787
diff changeset
1155 <default>on</default>
1063836dacea Documented "proxy_pass_request_body/headers" directives.
Vladimir Homutov <vl@nginx.com>
parents: 787
diff changeset
1156 <context>http</context>
1063836dacea Documented "proxy_pass_request_body/headers" directives.
Vladimir Homutov <vl@nginx.com>
parents: 787
diff changeset
1157 <context>server</context>
1063836dacea Documented "proxy_pass_request_body/headers" directives.
Vladimir Homutov <vl@nginx.com>
parents: 787
diff changeset
1158 <context>location</context>
1063836dacea Documented "proxy_pass_request_body/headers" directives.
Vladimir Homutov <vl@nginx.com>
parents: 787
diff changeset
1159
1063836dacea Documented "proxy_pass_request_body/headers" directives.
Vladimir Homutov <vl@nginx.com>
parents: 787
diff changeset
1160 <para>
966
95c3c3bbf1ce Text review.
Egor Nikitin <yegor.nikitin@gmail.com>
parents: 959
diff changeset
1161 Indicates whether the original request body is passed
789
1063836dacea Documented "proxy_pass_request_body/headers" directives.
Vladimir Homutov <vl@nginx.com>
parents: 787
diff changeset
1162 to the proxied server.
1063836dacea Documented "proxy_pass_request_body/headers" directives.
Vladimir Homutov <vl@nginx.com>
parents: 787
diff changeset
1163 <example>
1063836dacea Documented "proxy_pass_request_body/headers" directives.
Vladimir Homutov <vl@nginx.com>
parents: 787
diff changeset
1164 location /x-accel-redirect-here/ {
1063836dacea Documented "proxy_pass_request_body/headers" directives.
Vladimir Homutov <vl@nginx.com>
parents: 787
diff changeset
1165 proxy_method GET;
1063836dacea Documented "proxy_pass_request_body/headers" directives.
Vladimir Homutov <vl@nginx.com>
parents: 787
diff changeset
1166 proxy_pass_request_body off;
1063836dacea Documented "proxy_pass_request_body/headers" directives.
Vladimir Homutov <vl@nginx.com>
parents: 787
diff changeset
1167 proxy_set_header Content-Length "";
1063836dacea Documented "proxy_pass_request_body/headers" directives.
Vladimir Homutov <vl@nginx.com>
parents: 787
diff changeset
1168
1063836dacea Documented "proxy_pass_request_body/headers" directives.
Vladimir Homutov <vl@nginx.com>
parents: 787
diff changeset
1169 proxy_pass ...
1063836dacea Documented "proxy_pass_request_body/headers" directives.
Vladimir Homutov <vl@nginx.com>
parents: 787
diff changeset
1170 }
1063836dacea Documented "proxy_pass_request_body/headers" directives.
Vladimir Homutov <vl@nginx.com>
parents: 787
diff changeset
1171 </example>
1063836dacea Documented "proxy_pass_request_body/headers" directives.
Vladimir Homutov <vl@nginx.com>
parents: 787
diff changeset
1172 See also the <link id="proxy_set_header"/> and
1063836dacea Documented "proxy_pass_request_body/headers" directives.
Vladimir Homutov <vl@nginx.com>
parents: 787
diff changeset
1173 <link id="proxy_pass_request_headers"/> directives.
1063836dacea Documented "proxy_pass_request_body/headers" directives.
Vladimir Homutov <vl@nginx.com>
parents: 787
diff changeset
1174 </para>
1063836dacea Documented "proxy_pass_request_body/headers" directives.
Vladimir Homutov <vl@nginx.com>
parents: 787
diff changeset
1175
1063836dacea Documented "proxy_pass_request_body/headers" directives.
Vladimir Homutov <vl@nginx.com>
parents: 787
diff changeset
1176 </directive>
1063836dacea Documented "proxy_pass_request_body/headers" directives.
Vladimir Homutov <vl@nginx.com>
parents: 787
diff changeset
1177
1063836dacea Documented "proxy_pass_request_body/headers" directives.
Vladimir Homutov <vl@nginx.com>
parents: 787
diff changeset
1178
1063836dacea Documented "proxy_pass_request_body/headers" directives.
Vladimir Homutov <vl@nginx.com>
parents: 787
diff changeset
1179 <directive name="proxy_pass_request_headers">
1063836dacea Documented "proxy_pass_request_body/headers" directives.
Vladimir Homutov <vl@nginx.com>
parents: 787
diff changeset
1180 <syntax><literal>on</literal> | <literal>off</literal></syntax>
1063836dacea Documented "proxy_pass_request_body/headers" directives.
Vladimir Homutov <vl@nginx.com>
parents: 787
diff changeset
1181 <default>on</default>
1063836dacea Documented "proxy_pass_request_body/headers" directives.
Vladimir Homutov <vl@nginx.com>
parents: 787
diff changeset
1182 <context>http</context>
1063836dacea Documented "proxy_pass_request_body/headers" directives.
Vladimir Homutov <vl@nginx.com>
parents: 787
diff changeset
1183 <context>server</context>
1063836dacea Documented "proxy_pass_request_body/headers" directives.
Vladimir Homutov <vl@nginx.com>
parents: 787
diff changeset
1184 <context>location</context>
1063836dacea Documented "proxy_pass_request_body/headers" directives.
Vladimir Homutov <vl@nginx.com>
parents: 787
diff changeset
1185
1063836dacea Documented "proxy_pass_request_body/headers" directives.
Vladimir Homutov <vl@nginx.com>
parents: 787
diff changeset
1186 <para>
966
95c3c3bbf1ce Text review.
Egor Nikitin <yegor.nikitin@gmail.com>
parents: 959
diff changeset
1187 Indicates whether the header fields of the original request are passed
959
fbb4cc6f8c3d Text review of ngx_http_proxy_module.
Egor Nikitin <yegor.nikitin@gmail.com>
parents: 942
diff changeset
1188 to the proxied server.
789
1063836dacea Documented "proxy_pass_request_body/headers" directives.
Vladimir Homutov <vl@nginx.com>
parents: 787
diff changeset
1189 <example>
1063836dacea Documented "proxy_pass_request_body/headers" directives.
Vladimir Homutov <vl@nginx.com>
parents: 787
diff changeset
1190 location /x-accel-redirect-here/ {
1063836dacea Documented "proxy_pass_request_body/headers" directives.
Vladimir Homutov <vl@nginx.com>
parents: 787
diff changeset
1191 proxy_method GET;
1063836dacea Documented "proxy_pass_request_body/headers" directives.
Vladimir Homutov <vl@nginx.com>
parents: 787
diff changeset
1192 proxy_pass_request_headers off;
1063836dacea Documented "proxy_pass_request_body/headers" directives.
Vladimir Homutov <vl@nginx.com>
parents: 787
diff changeset
1193 proxy_pass_request_body off;
1063836dacea Documented "proxy_pass_request_body/headers" directives.
Vladimir Homutov <vl@nginx.com>
parents: 787
diff changeset
1194
1063836dacea Documented "proxy_pass_request_body/headers" directives.
Vladimir Homutov <vl@nginx.com>
parents: 787
diff changeset
1195 proxy_pass ...
1063836dacea Documented "proxy_pass_request_body/headers" directives.
Vladimir Homutov <vl@nginx.com>
parents: 787
diff changeset
1196 }
1063836dacea Documented "proxy_pass_request_body/headers" directives.
Vladimir Homutov <vl@nginx.com>
parents: 787
diff changeset
1197 </example>
1063836dacea Documented "proxy_pass_request_body/headers" directives.
Vladimir Homutov <vl@nginx.com>
parents: 787
diff changeset
1198 See also the <link id="proxy_set_header"/> and
1063836dacea Documented "proxy_pass_request_body/headers" directives.
Vladimir Homutov <vl@nginx.com>
parents: 787
diff changeset
1199 <link id="proxy_pass_request_body"/> directives.
1063836dacea Documented "proxy_pass_request_body/headers" directives.
Vladimir Homutov <vl@nginx.com>
parents: 787
diff changeset
1200 </para>
1063836dacea Documented "proxy_pass_request_body/headers" directives.
Vladimir Homutov <vl@nginx.com>
parents: 787
diff changeset
1201
1063836dacea Documented "proxy_pass_request_body/headers" directives.
Vladimir Homutov <vl@nginx.com>
parents: 787
diff changeset
1202 </directive>
1063836dacea Documented "proxy_pass_request_body/headers" directives.
Vladimir Homutov <vl@nginx.com>
parents: 787
diff changeset
1203
1063836dacea Documented "proxy_pass_request_body/headers" directives.
Vladimir Homutov <vl@nginx.com>
parents: 787
diff changeset
1204
281
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
1205 <directive name="proxy_redirect">
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
1206 <syntax><literal>default</literal></syntax>
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
1207 <syntax><literal>off</literal></syntax>
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
1208 <syntax><value>redirect</value> <value>replacement</value></syntax>
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
1209 <default>default</default>
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
1210 <context>http</context>
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
1211 <context>server</context>
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
1212 <context>location</context>
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
1213
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
1214 <para>
959
fbb4cc6f8c3d Text review of ngx_http_proxy_module.
Egor Nikitin <yegor.nikitin@gmail.com>
parents: 942
diff changeset
1215 Sets the text that should be changed in the <header>Location</header>
fbb4cc6f8c3d Text review of ngx_http_proxy_module.
Egor Nikitin <yegor.nikitin@gmail.com>
parents: 942
diff changeset
1216 and <header>Refresh</header> header fields of a proxied server response.
281
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
1217 Suppose a proxied server returned the header field
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
1218 “<literal>Location: http://localhost:8000/two/some/uri/</literal>”.
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
1219 The directive
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
1220 <example>
351
a4fa80755eab Consistently strip initial offset in examples.
Ruslan Ermilov <ru@nginx.com>
parents: 316
diff changeset
1221 proxy_redirect http://localhost:8000/two/ http://frontend/one/;
281
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
1222 </example>
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
1223 will rewrite this string to
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
1224 “<literal>Location: http://frontend/one/some/uri/</literal>”.
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
1225 </para>
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
1226
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
1227 <para>
959
fbb4cc6f8c3d Text review of ngx_http_proxy_module.
Egor Nikitin <yegor.nikitin@gmail.com>
parents: 942
diff changeset
1228 A server name may be omitted in the <value>replacement</value> string:
281
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
1229 <example>
351
a4fa80755eab Consistently strip initial offset in examples.
Ruslan Ermilov <ru@nginx.com>
parents: 316
diff changeset
1230 proxy_redirect http://localhost:8000/two/ /;
281
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
1231 </example>
959
fbb4cc6f8c3d Text review of ngx_http_proxy_module.
Egor Nikitin <yegor.nikitin@gmail.com>
parents: 942
diff changeset
1232 then the primary server’s name and port, if different from 80,
fbb4cc6f8c3d Text review of ngx_http_proxy_module.
Egor Nikitin <yegor.nikitin@gmail.com>
parents: 942
diff changeset
1233 will be inserted.
281
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
1234 </para>
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
1235
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
1236 <para>
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
1237 The default replacement specified by the <literal>default</literal> parameter
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
1238 uses the parameters of the
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
1239 <link doc="ngx_http_core_module.xml" id="location"/> and
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
1240 <link id="proxy_pass"/> directives.
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
1241 Hence, the two configurations below are equivalent:
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
1242 <example>
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
1243 location /one/ {
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
1244 proxy_pass http://upstream:port/two/;
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
1245 proxy_redirect default;
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
1246 </example>
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
1247
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
1248 <example>
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
1249 location /one/ {
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
1250 proxy_pass http://upstream:port/two/;
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
1251 proxy_redirect http://upstream:port/two/ /one/;
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
1252 </example>
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
1253 The <literal>default</literal> parameter is not permitted if
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
1254 <link id="proxy_pass"/> is specified using variables.
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
1255 </para>
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
1256
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
1257 <para>
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
1258 A <value>replacement</value> string can contain variables:
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
1259 <example>
351
a4fa80755eab Consistently strip initial offset in examples.
Ruslan Ermilov <ru@nginx.com>
parents: 316
diff changeset
1260 proxy_redirect http://localhost:8000/ http://$host:$server_port/;
281
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
1261 </example>
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
1262 </para>
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
1263
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
1264 <para>
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
1265 A <value>redirect</value> can also contain (1.1.11) variables:
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
1266 <example>
351
a4fa80755eab Consistently strip initial offset in examples.
Ruslan Ermilov <ru@nginx.com>
parents: 316
diff changeset
1267 proxy_redirect http://$proxy_host:8000/ /;
281
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
1268 </example>
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
1269 </para>
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
1270
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
1271 <para>
959
fbb4cc6f8c3d Text review of ngx_http_proxy_module.
Egor Nikitin <yegor.nikitin@gmail.com>
parents: 942
diff changeset
1272 The directive can be specified (1.1.11) using regular expressions.
fbb4cc6f8c3d Text review of ngx_http_proxy_module.
Egor Nikitin <yegor.nikitin@gmail.com>
parents: 942
diff changeset
1273 In this case, <value>redirect</value> should either start with
281
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
1274 the “<literal>~</literal>” symbol for a case-sensitive matching,
959
fbb4cc6f8c3d Text review of ngx_http_proxy_module.
Egor Nikitin <yegor.nikitin@gmail.com>
parents: 942
diff changeset
1275 or with the “<literal>~*</literal>” symbols for case-insensitive
281
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
1276 matching.
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
1277 A regular expression can contain named and positional captures,
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
1278 and <value>replacement</value> can reference them:
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
1279 <example>
351
a4fa80755eab Consistently strip initial offset in examples.
Ruslan Ermilov <ru@nginx.com>
parents: 316
diff changeset
1280 proxy_redirect ~^(http://[^:]+):\d+(/.+)$ $1$2;
a4fa80755eab Consistently strip initial offset in examples.
Ruslan Ermilov <ru@nginx.com>
parents: 316
diff changeset
1281 proxy_redirect ~*/user/([^/]+)/(.+)$ http://$1.example.com/$2;
281
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
1282 </example>
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
1283 </para>
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
1284
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
1285 <para>
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
1286 There could be several <literal>proxy_redirect</literal> directives:
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
1287 <example>
351
a4fa80755eab Consistently strip initial offset in examples.
Ruslan Ermilov <ru@nginx.com>
parents: 316
diff changeset
1288 proxy_redirect default;
a4fa80755eab Consistently strip initial offset in examples.
Ruslan Ermilov <ru@nginx.com>
parents: 316
diff changeset
1289 proxy_redirect http://localhost:8000/ /;
a4fa80755eab Consistently strip initial offset in examples.
Ruslan Ermilov <ru@nginx.com>
parents: 316
diff changeset
1290 proxy_redirect http://www.example.com/ /;
281
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
1291 </example>
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
1292 </para>
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
1293
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
1294 <para>
959
fbb4cc6f8c3d Text review of ngx_http_proxy_module.
Egor Nikitin <yegor.nikitin@gmail.com>
parents: 942
diff changeset
1295 The <literal>off</literal> parameter cancels the effect of all
281
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
1296 <literal>proxy_redirect</literal> directives on the current level:
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
1297 <example>
351
a4fa80755eab Consistently strip initial offset in examples.
Ruslan Ermilov <ru@nginx.com>
parents: 316
diff changeset
1298 proxy_redirect off;
a4fa80755eab Consistently strip initial offset in examples.
Ruslan Ermilov <ru@nginx.com>
parents: 316
diff changeset
1299 proxy_redirect default;
a4fa80755eab Consistently strip initial offset in examples.
Ruslan Ermilov <ru@nginx.com>
parents: 316
diff changeset
1300 proxy_redirect http://localhost:8000/ /;
a4fa80755eab Consistently strip initial offset in examples.
Ruslan Ermilov <ru@nginx.com>
parents: 316
diff changeset
1301 proxy_redirect http://www.example.com/ /;
281
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
1302 </example>
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
1303 </para>
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
1304
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
1305 <para>
959
fbb4cc6f8c3d Text review of ngx_http_proxy_module.
Egor Nikitin <yegor.nikitin@gmail.com>
parents: 942
diff changeset
1306 Using this directive, it is also possible to add host names to relative
281
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
1307 redirects issued by a proxied server:
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
1308 <example>
351
a4fa80755eab Consistently strip initial offset in examples.
Ruslan Ermilov <ru@nginx.com>
parents: 316
diff changeset
1309 proxy_redirect / /;
281
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
1310 </example>
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
1311 </para>
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
1312
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
1313 </directive>
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
1314
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
1315
773
24b1b0101250 Documented "send_lowat" directive in fastcgi and proxy modules.
Vladimir Homutov <vl@nginx.com>
parents: 772
diff changeset
1316 <directive name="proxy_send_lowat">
24b1b0101250 Documented "send_lowat" directive in fastcgi and proxy modules.
Vladimir Homutov <vl@nginx.com>
parents: 772
diff changeset
1317 <syntax><value>size</value></syntax>
24b1b0101250 Documented "send_lowat" directive in fastcgi and proxy modules.
Vladimir Homutov <vl@nginx.com>
parents: 772
diff changeset
1318 <default>0</default>
24b1b0101250 Documented "send_lowat" directive in fastcgi and proxy modules.
Vladimir Homutov <vl@nginx.com>
parents: 772
diff changeset
1319 <context>http</context>
24b1b0101250 Documented "send_lowat" directive in fastcgi and proxy modules.
Vladimir Homutov <vl@nginx.com>
parents: 772
diff changeset
1320 <context>server</context>
24b1b0101250 Documented "send_lowat" directive in fastcgi and proxy modules.
Vladimir Homutov <vl@nginx.com>
parents: 772
diff changeset
1321 <context>location</context>
24b1b0101250 Documented "send_lowat" directive in fastcgi and proxy modules.
Vladimir Homutov <vl@nginx.com>
parents: 772
diff changeset
1322
24b1b0101250 Documented "send_lowat" directive in fastcgi and proxy modules.
Vladimir Homutov <vl@nginx.com>
parents: 772
diff changeset
1323 <para>
959
fbb4cc6f8c3d Text review of ngx_http_proxy_module.
Egor Nikitin <yegor.nikitin@gmail.com>
parents: 942
diff changeset
1324 If the directive is set to a non-zero value, nginx will try to
fbb4cc6f8c3d Text review of ngx_http_proxy_module.
Egor Nikitin <yegor.nikitin@gmail.com>
parents: 942
diff changeset
1325 minimize the number
773
24b1b0101250 Documented "send_lowat" directive in fastcgi and proxy modules.
Vladimir Homutov <vl@nginx.com>
parents: 772
diff changeset
1326 of send operations on outgoing connections to a proxied server by using either
24b1b0101250 Documented "send_lowat" directive in fastcgi and proxy modules.
Vladimir Homutov <vl@nginx.com>
parents: 772
diff changeset
1327 <c-def>NOTE_LOWAT</c-def> flag of the
24b1b0101250 Documented "send_lowat" directive in fastcgi and proxy modules.
Vladimir Homutov <vl@nginx.com>
parents: 772
diff changeset
1328 <link doc="../events.xml" id="kqueue"/> method,
24b1b0101250 Documented "send_lowat" directive in fastcgi and proxy modules.
Vladimir Homutov <vl@nginx.com>
parents: 772
diff changeset
1329 or the <c-def>SO_SNDLOWAT</c-def> socket option,
24b1b0101250 Documented "send_lowat" directive in fastcgi and proxy modules.
Vladimir Homutov <vl@nginx.com>
parents: 772
diff changeset
1330 with the specified <value>size</value>.
24b1b0101250 Documented "send_lowat" directive in fastcgi and proxy modules.
Vladimir Homutov <vl@nginx.com>
parents: 772
diff changeset
1331 </para>
24b1b0101250 Documented "send_lowat" directive in fastcgi and proxy modules.
Vladimir Homutov <vl@nginx.com>
parents: 772
diff changeset
1332
24b1b0101250 Documented "send_lowat" directive in fastcgi and proxy modules.
Vladimir Homutov <vl@nginx.com>
parents: 772
diff changeset
1333 <para>
24b1b0101250 Documented "send_lowat" directive in fastcgi and proxy modules.
Vladimir Homutov <vl@nginx.com>
parents: 772
diff changeset
1334 This directive is ignored on Linux, Solaris, and Windows.
24b1b0101250 Documented "send_lowat" directive in fastcgi and proxy modules.
Vladimir Homutov <vl@nginx.com>
parents: 772
diff changeset
1335 </para>
24b1b0101250 Documented "send_lowat" directive in fastcgi and proxy modules.
Vladimir Homutov <vl@nginx.com>
parents: 772
diff changeset
1336
24b1b0101250 Documented "send_lowat" directive in fastcgi and proxy modules.
Vladimir Homutov <vl@nginx.com>
parents: 772
diff changeset
1337 </directive>
24b1b0101250 Documented "send_lowat" directive in fastcgi and proxy modules.
Vladimir Homutov <vl@nginx.com>
parents: 772
diff changeset
1338
24b1b0101250 Documented "send_lowat" directive in fastcgi and proxy modules.
Vladimir Homutov <vl@nginx.com>
parents: 772
diff changeset
1339
281
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
1340 <directive name="proxy_send_timeout">
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
1341 <syntax><value>time</value></syntax>
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
1342 <default>60s</default>
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
1343 <context>http</context>
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
1344 <context>server</context>
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
1345 <context>location</context>
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
1346
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
1347 <para>
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
1348 Sets a timeout for transmitting a request to the proxied server.
966
95c3c3bbf1ce Text review.
Egor Nikitin <yegor.nikitin@gmail.com>
parents: 959
diff changeset
1349 A timeout is set only between two successive write operations,
281
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
1350 not for the transmission of the whole request.
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
1351 If a proxied server does not receive anything within this time,
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
1352 a connection is closed.
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
1353 </para>
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
1354
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
1355 </directive>
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
1356
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
1357
787
180a64c709d8 Documented "proxy_set_body" and "proxy_method" directives.
Vladimir Homutov <vl@nginx.com>
parents: 773
diff changeset
1358 <directive name="proxy_set_body">
180a64c709d8 Documented "proxy_set_body" and "proxy_method" directives.
Vladimir Homutov <vl@nginx.com>
parents: 773
diff changeset
1359 <syntax><value>value</value></syntax>
180a64c709d8 Documented "proxy_set_body" and "proxy_method" directives.
Vladimir Homutov <vl@nginx.com>
parents: 773
diff changeset
1360 <default/>
180a64c709d8 Documented "proxy_set_body" and "proxy_method" directives.
Vladimir Homutov <vl@nginx.com>
parents: 773
diff changeset
1361 <context>http</context>
180a64c709d8 Documented "proxy_set_body" and "proxy_method" directives.
Vladimir Homutov <vl@nginx.com>
parents: 773
diff changeset
1362 <context>server</context>
180a64c709d8 Documented "proxy_set_body" and "proxy_method" directives.
Vladimir Homutov <vl@nginx.com>
parents: 773
diff changeset
1363 <context>location</context>
180a64c709d8 Documented "proxy_set_body" and "proxy_method" directives.
Vladimir Homutov <vl@nginx.com>
parents: 773
diff changeset
1364
180a64c709d8 Documented "proxy_set_body" and "proxy_method" directives.
Vladimir Homutov <vl@nginx.com>
parents: 773
diff changeset
1365 <para>
959
fbb4cc6f8c3d Text review of ngx_http_proxy_module.
Egor Nikitin <yegor.nikitin@gmail.com>
parents: 942
diff changeset
1366 Allows redefining the request body passed to the proxied server.
787
180a64c709d8 Documented "proxy_set_body" and "proxy_method" directives.
Vladimir Homutov <vl@nginx.com>
parents: 773
diff changeset
1367 A <value>value</value> can contain text, variables, and their combination.
180a64c709d8 Documented "proxy_set_body" and "proxy_method" directives.
Vladimir Homutov <vl@nginx.com>
parents: 773
diff changeset
1368 </para>
180a64c709d8 Documented "proxy_set_body" and "proxy_method" directives.
Vladimir Homutov <vl@nginx.com>
parents: 773
diff changeset
1369
180a64c709d8 Documented "proxy_set_body" and "proxy_method" directives.
Vladimir Homutov <vl@nginx.com>
parents: 773
diff changeset
1370 </directive>
180a64c709d8 Documented "proxy_set_body" and "proxy_method" directives.
Vladimir Homutov <vl@nginx.com>
parents: 773
diff changeset
1371
180a64c709d8 Documented "proxy_set_body" and "proxy_method" directives.
Vladimir Homutov <vl@nginx.com>
parents: 773
diff changeset
1372
281
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
1373 <directive name="proxy_set_header">
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
1374 <syntax><value>field</value> <value>value</value></syntax>
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
1375 <default>Host $proxy_host</default>
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
1376 <default>Connection close</default>
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
1377 <context>http</context>
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
1378 <context>server</context>
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
1379 <context>location</context>
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
1380
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
1381 <para>
959
fbb4cc6f8c3d Text review of ngx_http_proxy_module.
Egor Nikitin <yegor.nikitin@gmail.com>
parents: 942
diff changeset
1382 Allows redefining or appending fields to the request header
789
1063836dacea Documented "proxy_pass_request_body/headers" directives.
Vladimir Homutov <vl@nginx.com>
parents: 787
diff changeset
1383 <link id="proxy_pass_request_headers">passed</link> to the proxied server.
959
fbb4cc6f8c3d Text review of ngx_http_proxy_module.
Egor Nikitin <yegor.nikitin@gmail.com>
parents: 942
diff changeset
1384 A <value>value</value> can contain text, variables, and their combinations.
281
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
1385 These directives are inherited from the previous level if and
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
1386 only if there are no
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
1387 <literal>proxy_set_header</literal>
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
1388 directives defined on the current level.
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
1389 By default, only two fields are redefined:
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
1390 <example>
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
1391 proxy_set_header Host $proxy_host;
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
1392 proxy_set_header Connection close;
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
1393 </example>
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
1394 </para>
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
1395
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
1396 <para>
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
1397 An unchanged <header>Host</header> request header field can be passed like this:
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
1398 <example>
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
1399 proxy_set_header Host $http_host;
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
1400 </example>
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
1401 </para>
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
1402
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
1403 <para>
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
1404 However, if this field is not present in a client request header then
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
1405 nothing will be passed.
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
1406 In such a case it is better to use the <var>$host</var> variable&mdash;its
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
1407 value equals the server name in the <header>Host</header> request header
959
fbb4cc6f8c3d Text review of ngx_http_proxy_module.
Egor Nikitin <yegor.nikitin@gmail.com>
parents: 942
diff changeset
1408 field or the primary server name if this field is not present:
281
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
1409 <example>
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
1410 proxy_set_header Host $host;
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
1411 </example>
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
1412 </para>
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
1413
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
1414 <para>
959
fbb4cc6f8c3d Text review of ngx_http_proxy_module.
Egor Nikitin <yegor.nikitin@gmail.com>
parents: 942
diff changeset
1415 In addition, the server name can be passed together with the port of the
281
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
1416 proxied server:
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
1417 <example>
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
1418 proxy_set_header Host $host:$proxy_port;
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
1419 </example>
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
1420 </para>
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
1421
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
1422 <para>
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
1423 If the value of a header field is an empty string then this
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
1424 field will not be passed to a proxied server:
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
1425 <example>
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
1426 proxy_set_header Accept-Encoding "";
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
1427 </example>
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
1428 </para>
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
1429
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
1430 </directive>
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
1431
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
1432
993
a59aba3d4b67 Proxy: documented the "proxy_ssl_ciphers" directive.
Andrei Belov <defan@nginx.com>
parents: 992
diff changeset
1433 <directive name="proxy_ssl_ciphers">
a59aba3d4b67 Proxy: documented the "proxy_ssl_ciphers" directive.
Andrei Belov <defan@nginx.com>
parents: 992
diff changeset
1434 <syntax><value>ciphers</value></syntax>
a59aba3d4b67 Proxy: documented the "proxy_ssl_ciphers" directive.
Andrei Belov <defan@nginx.com>
parents: 992
diff changeset
1435 <default>DEFAULT</default>
a59aba3d4b67 Proxy: documented the "proxy_ssl_ciphers" directive.
Andrei Belov <defan@nginx.com>
parents: 992
diff changeset
1436 <context>http</context>
a59aba3d4b67 Proxy: documented the "proxy_ssl_ciphers" directive.
Andrei Belov <defan@nginx.com>
parents: 992
diff changeset
1437 <context>server</context>
a59aba3d4b67 Proxy: documented the "proxy_ssl_ciphers" directive.
Andrei Belov <defan@nginx.com>
parents: 992
diff changeset
1438 <context>location</context>
a59aba3d4b67 Proxy: documented the "proxy_ssl_ciphers" directive.
Andrei Belov <defan@nginx.com>
parents: 992
diff changeset
1439 <appeared-in>1.5.6</appeared-in>
a59aba3d4b67 Proxy: documented the "proxy_ssl_ciphers" directive.
Andrei Belov <defan@nginx.com>
parents: 992
diff changeset
1440
a59aba3d4b67 Proxy: documented the "proxy_ssl_ciphers" directive.
Andrei Belov <defan@nginx.com>
parents: 992
diff changeset
1441 <para>
a59aba3d4b67 Proxy: documented the "proxy_ssl_ciphers" directive.
Andrei Belov <defan@nginx.com>
parents: 992
diff changeset
1442 Specifies the enabled ciphers for requests to a proxied HTTPS server.
a59aba3d4b67 Proxy: documented the "proxy_ssl_ciphers" directive.
Andrei Belov <defan@nginx.com>
parents: 992
diff changeset
1443 The ciphers are specified in the format understood by the OpenSSL library.
a59aba3d4b67 Proxy: documented the "proxy_ssl_ciphers" directive.
Andrei Belov <defan@nginx.com>
parents: 992
diff changeset
1444 </para>
a59aba3d4b67 Proxy: documented the "proxy_ssl_ciphers" directive.
Andrei Belov <defan@nginx.com>
parents: 992
diff changeset
1445
a59aba3d4b67 Proxy: documented the "proxy_ssl_ciphers" directive.
Andrei Belov <defan@nginx.com>
parents: 992
diff changeset
1446 <para>
a59aba3d4b67 Proxy: documented the "proxy_ssl_ciphers" directive.
Andrei Belov <defan@nginx.com>
parents: 992
diff changeset
1447 The full list can be viewed using the
a59aba3d4b67 Proxy: documented the "proxy_ssl_ciphers" directive.
Andrei Belov <defan@nginx.com>
parents: 992
diff changeset
1448 “<command>openssl ciphers</command>” command.
a59aba3d4b67 Proxy: documented the "proxy_ssl_ciphers" directive.
Andrei Belov <defan@nginx.com>
parents: 992
diff changeset
1449 </para>
a59aba3d4b67 Proxy: documented the "proxy_ssl_ciphers" directive.
Andrei Belov <defan@nginx.com>
parents: 992
diff changeset
1450
a59aba3d4b67 Proxy: documented the "proxy_ssl_ciphers" directive.
Andrei Belov <defan@nginx.com>
parents: 992
diff changeset
1451 </directive>
a59aba3d4b67 Proxy: documented the "proxy_ssl_ciphers" directive.
Andrei Belov <defan@nginx.com>
parents: 992
diff changeset
1452
a59aba3d4b67 Proxy: documented the "proxy_ssl_ciphers" directive.
Andrei Belov <defan@nginx.com>
parents: 992
diff changeset
1453
281
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
1454 <directive name="proxy_ssl_session_reuse">
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
1455 <syntax><literal>on</literal> | <literal>off</literal></syntax>
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
1456 <default>on</default>
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
1457 <context>http</context>
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
1458 <context>server</context>
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
1459 <context>location</context>
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
1460
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
1461 <para>
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
1462 Determines whether SSL sessions can be reused when working with
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
1463 the proxied server.
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
1464 If the errors
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
1465 “<literal>SSL3_GET_FINISHED:digest check failed</literal>”
959
fbb4cc6f8c3d Text review of ngx_http_proxy_module.
Egor Nikitin <yegor.nikitin@gmail.com>
parents: 942
diff changeset
1466 appear in the logs, try disabling session reuse.
281
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
1467 </para>
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
1468
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
1469 </directive>
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
1470
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
1471
985
e4704604ed29 Proxy: documented the "proxy_ssl_protocols" directive.
Andrei Belov <defan@nginx.com>
parents: 966
diff changeset
1472 <directive name="proxy_ssl_protocols">
e4704604ed29 Proxy: documented the "proxy_ssl_protocols" directive.
Andrei Belov <defan@nginx.com>
parents: 966
diff changeset
1473 <syntax>
e4704604ed29 Proxy: documented the "proxy_ssl_protocols" directive.
Andrei Belov <defan@nginx.com>
parents: 966
diff changeset
1474 [<literal>SSLv2</literal>]
e4704604ed29 Proxy: documented the "proxy_ssl_protocols" directive.
Andrei Belov <defan@nginx.com>
parents: 966
diff changeset
1475 [<literal>SSLv3</literal>]
e4704604ed29 Proxy: documented the "proxy_ssl_protocols" directive.
Andrei Belov <defan@nginx.com>
parents: 966
diff changeset
1476 [<literal>TLSv1</literal>]
e4704604ed29 Proxy: documented the "proxy_ssl_protocols" directive.
Andrei Belov <defan@nginx.com>
parents: 966
diff changeset
1477 [<literal>TLSv1.1</literal>]
e4704604ed29 Proxy: documented the "proxy_ssl_protocols" directive.
Andrei Belov <defan@nginx.com>
parents: 966
diff changeset
1478 [<literal>TLSv1.2</literal>]</syntax>
e4704604ed29 Proxy: documented the "proxy_ssl_protocols" directive.
Andrei Belov <defan@nginx.com>
parents: 966
diff changeset
1479 <default>SSLv3 TLSv1 TLSv1.1 TLSv1.2</default>
e4704604ed29 Proxy: documented the "proxy_ssl_protocols" directive.
Andrei Belov <defan@nginx.com>
parents: 966
diff changeset
1480 <context>http</context>
e4704604ed29 Proxy: documented the "proxy_ssl_protocols" directive.
Andrei Belov <defan@nginx.com>
parents: 966
diff changeset
1481 <context>server</context>
e4704604ed29 Proxy: documented the "proxy_ssl_protocols" directive.
Andrei Belov <defan@nginx.com>
parents: 966
diff changeset
1482 <context>location</context>
e4704604ed29 Proxy: documented the "proxy_ssl_protocols" directive.
Andrei Belov <defan@nginx.com>
parents: 966
diff changeset
1483 <appeared-in>1.5.6</appeared-in>
e4704604ed29 Proxy: documented the "proxy_ssl_protocols" directive.
Andrei Belov <defan@nginx.com>
parents: 966
diff changeset
1484
e4704604ed29 Proxy: documented the "proxy_ssl_protocols" directive.
Andrei Belov <defan@nginx.com>
parents: 966
diff changeset
1485 <para>
993
a59aba3d4b67 Proxy: documented the "proxy_ssl_ciphers" directive.
Andrei Belov <defan@nginx.com>
parents: 992
diff changeset
1486 Enables the specified protocols for requests to a proxied HTTPS server.
985
e4704604ed29 Proxy: documented the "proxy_ssl_protocols" directive.
Andrei Belov <defan@nginx.com>
parents: 966
diff changeset
1487 </para>
e4704604ed29 Proxy: documented the "proxy_ssl_protocols" directive.
Andrei Belov <defan@nginx.com>
parents: 966
diff changeset
1488
e4704604ed29 Proxy: documented the "proxy_ssl_protocols" directive.
Andrei Belov <defan@nginx.com>
parents: 966
diff changeset
1489 </directive>
e4704604ed29 Proxy: documented the "proxy_ssl_protocols" directive.
Andrei Belov <defan@nginx.com>
parents: 966
diff changeset
1490
e4704604ed29 Proxy: documented the "proxy_ssl_protocols" directive.
Andrei Belov <defan@nginx.com>
parents: 966
diff changeset
1491
281
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
1492 <directive name="proxy_store">
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
1493 <syntax>
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
1494 <literal>on</literal> |
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
1495 <literal>off</literal> |
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
1496 <value>string</value></syntax>
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
1497 <default>off</default>
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
1498 <context>http</context>
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
1499 <context>server</context>
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
1500 <context>location</context>
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
1501
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
1502 <para>
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
1503 Enables saving of files to a disk.
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
1504 The <literal>on</literal> parameter saves files with paths
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
1505 corresponding to the directives
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
1506 <link doc="ngx_http_core_module.xml" id="alias"/> or
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
1507 <link doc="ngx_http_core_module.xml" id="root"/>.
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
1508 The <literal>off</literal> parameter disables saving of files.
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
1509 In addition, the file name can be set explicitly using the
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
1510 <value>string</value> with variables:
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
1511 <example>
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
1512 proxy_store /data/www$original_uri;
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
1513 </example>
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
1514 </para>
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
1515
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
1516 <para>
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
1517 The modification time of files is set according to the received
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
1518 <header>Last-Modified</header> response header field.
966
95c3c3bbf1ce Text review.
Egor Nikitin <yegor.nikitin@gmail.com>
parents: 959
diff changeset
1519 A response is first written to a temporary file, and then the file is renamed.
959
fbb4cc6f8c3d Text review of ngx_http_proxy_module.
Egor Nikitin <yegor.nikitin@gmail.com>
parents: 942
diff changeset
1520 Starting from version 0.8.9, temporary files and the persistent store
966
95c3c3bbf1ce Text review.
Egor Nikitin <yegor.nikitin@gmail.com>
parents: 959
diff changeset
1521 can be put on different file systems.
95c3c3bbf1ce Text review.
Egor Nikitin <yegor.nikitin@gmail.com>
parents: 959
diff changeset
1522 However, be aware that in this case a file is copied
95c3c3bbf1ce Text review.
Egor Nikitin <yegor.nikitin@gmail.com>
parents: 959
diff changeset
1523 across two file systems instead of the cheap renaming operation.
281
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
1524 It is thus recommended that for any given location both saved files and a
966
95c3c3bbf1ce Text review.
Egor Nikitin <yegor.nikitin@gmail.com>
parents: 959
diff changeset
1525 directory holding temporary files, set by the <link id="proxy_temp_path"/>
95c3c3bbf1ce Text review.
Egor Nikitin <yegor.nikitin@gmail.com>
parents: 959
diff changeset
1526 directive, are put on the same file system.
281
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
1527 </para>
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
1528
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
1529 <para>
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
1530 This directive can be used to create local copies of static unchangeable
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
1531 files, e.g.:
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
1532 <example>
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
1533 location /images/ {
1005
2275611970dd Removed open_file_cache_errors from proxy_store examples.
Maxim Dounin <mdounin@mdounin.ru>
parents: 993
diff changeset
1534 root /data/www;
2275611970dd Removed open_file_cache_errors from proxy_store examples.
Maxim Dounin <mdounin@mdounin.ru>
parents: 993
diff changeset
1535 error_page 404 = /fetch$uri;
281
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
1536 }
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
1537
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
1538 location /fetch/ {
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
1539 internal;
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
1540
1005
2275611970dd Removed open_file_cache_errors from proxy_store examples.
Maxim Dounin <mdounin@mdounin.ru>
parents: 993
diff changeset
1541 proxy_pass http://backend/;
2275611970dd Removed open_file_cache_errors from proxy_store examples.
Maxim Dounin <mdounin@mdounin.ru>
parents: 993
diff changeset
1542 proxy_store on;
2275611970dd Removed open_file_cache_errors from proxy_store examples.
Maxim Dounin <mdounin@mdounin.ru>
parents: 993
diff changeset
1543 proxy_store_access user:rw group:rw all:r;
2275611970dd Removed open_file_cache_errors from proxy_store examples.
Maxim Dounin <mdounin@mdounin.ru>
parents: 993
diff changeset
1544 proxy_temp_path /data/temp;
281
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
1545
1005
2275611970dd Removed open_file_cache_errors from proxy_store examples.
Maxim Dounin <mdounin@mdounin.ru>
parents: 993
diff changeset
1546 alias /data/www/;
281
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
1547 }
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
1548 </example>
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
1549 </para>
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
1550
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
1551 <para>
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
1552 or like this:
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
1553 <example>
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
1554 location /images/ {
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
1555 root /data/www;
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
1556 error_page 404 = @fetch;
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
1557 }
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
1558
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
1559 location @fetch {
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
1560 internal;
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
1561
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
1562 proxy_pass http://backend;
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
1563 proxy_store on;
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
1564 proxy_store_access user:rw group:rw all:r;
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
1565 proxy_temp_path /data/temp;
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
1566
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
1567 root /data/www;
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
1568 }
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
1569 </example>
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
1570 </para>
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
1571
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
1572 </directive>
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
1573
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
1574
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
1575 <directive name="proxy_store_access">
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
1576 <syntax><value>users</value>:<value>permissions</value> ...</syntax>
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
1577 <default>user:rw</default>
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
1578 <context>http</context>
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
1579 <context>server</context>
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
1580 <context>location</context>
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
1581
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
1582 <para>
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
1583 Sets access permissions for newly created files and directories, e.g.:
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
1584 <example>
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
1585 proxy_store_access user:rw group:rw all:r;
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
1586 </example>
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
1587 </para>
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
1588
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
1589 <para>
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
1590 If any <literal>group</literal> or <literal>all</literal> access permissions
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
1591 are specified then <literal>user</literal> permissions may be omitted:
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
1592 <example>
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
1593 proxy_store_access group:rw all:r;
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
1594 </example>
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
1595 </para>
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
1596
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
1597 </directive>
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
1598
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
1599
405
781b23ba3b0a Documented the following directives: proxy_busy_buffers_size,
Ruslan Ermilov <ru@nginx.com>
parents: 364
diff changeset
1600 <directive name="proxy_temp_file_write_size">
781b23ba3b0a Documented the following directives: proxy_busy_buffers_size,
Ruslan Ermilov <ru@nginx.com>
parents: 364
diff changeset
1601 <syntax><value>size</value></syntax>
781b23ba3b0a Documented the following directives: proxy_busy_buffers_size,
Ruslan Ermilov <ru@nginx.com>
parents: 364
diff changeset
1602 <default>8k|16k</default>
781b23ba3b0a Documented the following directives: proxy_busy_buffers_size,
Ruslan Ermilov <ru@nginx.com>
parents: 364
diff changeset
1603 <context>http</context>
781b23ba3b0a Documented the following directives: proxy_busy_buffers_size,
Ruslan Ermilov <ru@nginx.com>
parents: 364
diff changeset
1604 <context>server</context>
781b23ba3b0a Documented the following directives: proxy_busy_buffers_size,
Ruslan Ermilov <ru@nginx.com>
parents: 364
diff changeset
1605 <context>location</context>
781b23ba3b0a Documented the following directives: proxy_busy_buffers_size,
Ruslan Ermilov <ru@nginx.com>
parents: 364
diff changeset
1606
781b23ba3b0a Documented the following directives: proxy_busy_buffers_size,
Ruslan Ermilov <ru@nginx.com>
parents: 364
diff changeset
1607 <para>
781b23ba3b0a Documented the following directives: proxy_busy_buffers_size,
Ruslan Ermilov <ru@nginx.com>
parents: 364
diff changeset
1608 Limits the <value>size</value> of data written to a temporary file
781b23ba3b0a Documented the following directives: proxy_busy_buffers_size,
Ruslan Ermilov <ru@nginx.com>
parents: 364
diff changeset
1609 at a time, when buffering of responses from the proxied server
781b23ba3b0a Documented the following directives: proxy_busy_buffers_size,
Ruslan Ermilov <ru@nginx.com>
parents: 364
diff changeset
1610 to temporary files is enabled.
781b23ba3b0a Documented the following directives: proxy_busy_buffers_size,
Ruslan Ermilov <ru@nginx.com>
parents: 364
diff changeset
1611 By default, <value>size</value> is limited by two buffers set by the
781b23ba3b0a Documented the following directives: proxy_busy_buffers_size,
Ruslan Ermilov <ru@nginx.com>
parents: 364
diff changeset
1612 <link id="proxy_buffer_size"/> and <link id="proxy_buffers"/> directives.
781b23ba3b0a Documented the following directives: proxy_busy_buffers_size,
Ruslan Ermilov <ru@nginx.com>
parents: 364
diff changeset
1613 The maximum size of a temporary file is set by the
781b23ba3b0a Documented the following directives: proxy_busy_buffers_size,
Ruslan Ermilov <ru@nginx.com>
parents: 364
diff changeset
1614 <link id="proxy_max_temp_file_size"/> directive.
781b23ba3b0a Documented the following directives: proxy_busy_buffers_size,
Ruslan Ermilov <ru@nginx.com>
parents: 364
diff changeset
1615 </para>
781b23ba3b0a Documented the following directives: proxy_busy_buffers_size,
Ruslan Ermilov <ru@nginx.com>
parents: 364
diff changeset
1616
781b23ba3b0a Documented the following directives: proxy_busy_buffers_size,
Ruslan Ermilov <ru@nginx.com>
parents: 364
diff changeset
1617 </directive>
781b23ba3b0a Documented the following directives: proxy_busy_buffers_size,
Ruslan Ermilov <ru@nginx.com>
parents: 364
diff changeset
1618
781b23ba3b0a Documented the following directives: proxy_busy_buffers_size,
Ruslan Ermilov <ru@nginx.com>
parents: 364
diff changeset
1619
281
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
1620 <directive name="proxy_temp_path">
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
1621 <syntax>
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
1622 <value>path</value>
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
1623 [<value>level1</value>
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
1624 [<value>level2</value>
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
1625 [<value>level3</value>]]]</syntax>
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
1626 <default>proxy_temp</default>
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
1627 <context>http</context>
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
1628 <context>server</context>
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
1629 <context>location</context>
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
1630
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
1631 <para>
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
1632 Defines a directory for storing temporary files
405
781b23ba3b0a Documented the following directives: proxy_busy_buffers_size,
Ruslan Ermilov <ru@nginx.com>
parents: 364
diff changeset
1633 with data received from proxied servers.
281
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
1634 Up to three-level subdirectory hierarchy can be used underneath the specified
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
1635 directory.
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
1636 For example, in the following configuration
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
1637 <example>
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
1638 proxy_temp_path /spool/nginx/proxy_temp 1 2;
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
1639 </example>
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
1640 a temporary file might look like this:
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
1641 <example>
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
1642 /spool/nginx/proxy_temp/<emphasis>7</emphasis>/<emphasis>45</emphasis>/00000123<emphasis>457</emphasis>
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
1643 </example>
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
1644 </para>
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
1645
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
1646 </directive>
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
1647
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
1648 </section>
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
1649
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
1650
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
1651 <section id="variables" name="Embedded Variables">
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
1652
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
1653 <para>
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
1654 The <literal>ngx_http_proxy_module</literal> module supports embedded variables
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
1655 that can be used to compose headers using the
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
1656 <link id="proxy_set_header"/> directive:
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
1657 <list type="tag">
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
1658
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
1659 <tag-name><var>$proxy_host</var></tag-name>
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
1660 <tag-desc>name and port of a proxied server;</tag-desc>
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
1661
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
1662 <tag-name><var>$proxy_port</var></tag-name>
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
1663 <tag-desc>port of a proxied server;</tag-desc>
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
1664
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
1665 <tag-name><var>$proxy_add_x_forwarded_for</var></tag-name>
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
1666 <tag-desc>the <header>X-Forwarded-For</header> client request header field
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
1667 with the <var>$remote_addr</var> variable appended to it, separated by a comma.
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
1668 If the <header>X-Forwarded-For</header> field is not present in the client
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
1669 request header, the <var>$proxy_add_x_forwarded_for</var> variable is equal
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
1670 to the <var>$remote_addr</var> variable.</tag-desc>
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
1671 </list>
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
1672 </para>
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
1673
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
1674 </section>
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
1675
7142ddd2764c Translated current version of ngx_http_proxy_module documentation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
1676 </module>