Mercurial > hg > nginx-site
comparison xml/en/docs/stream/ngx_stream_module.xml @ 1394:66f227952864
Somewhat revamped the stream module documentation.
author | Ruslan Ermilov <ru@nginx.com> |
---|---|
date | Tue, 20 Jan 2015 15:38:27 +0300 |
parents | f1e14d87d833 |
children |
comparison
equal
deleted
inserted
replaced
1393:15e8779f0ceb | 1394:66f227952864 |
---|---|
8 <!DOCTYPE module SYSTEM "../../../../dtd/module.dtd"> | 8 <!DOCTYPE module SYSTEM "../../../../dtd/module.dtd"> |
9 | 9 |
10 <module name="Module ngx_stream_module" | 10 <module name="Module ngx_stream_module" |
11 link="/en/docs/stream/ngx_stream_module.html" | 11 link="/en/docs/stream/ngx_stream_module.html" |
12 lang="en" | 12 lang="en" |
13 rev="1"> | 13 rev="2"> |
14 | 14 |
15 <section id="summary"> | 15 <section id="summary"> |
16 | 16 |
17 <para> | 17 <para> |
18 The <literal>stream</literal> module (1.7.7) provides | 18 The <literal>ngx_stream_module</literal> module (1.7.7) provides |
19 proxying TCP and UNIX-domain socket connections. | 19 support for proxying TCP and UNIX-domain socket connections. |
20 </para> | 20 </para> |
21 | 21 |
22 <para> | 22 <para> |
23 <note> | 23 <note> |
24 This module is available as part of our | 24 This module is available as part of our |
25 <commercial_version>commercial subscription</commercial_version>. | 25 <commercial_version>commercial subscription</commercial_version>. |
26 </note> | 26 </note> |
27 </para> | 27 </para> |
28 | 28 |
29 </section> | 29 </section> |
30 | |
30 | 31 |
31 <section id="example" name="Example Configuration"> | 32 <section id="example" name="Example Configuration"> |
32 | 33 |
33 <para> | 34 <para> |
34 <example> | 35 <example> |
47 proxy_pass backend; | 48 proxy_pass backend; |
48 } | 49 } |
49 } | 50 } |
50 </example> | 51 </example> |
51 In this example, a server that listens on port 9000 | 52 In this example, a server that listens on port 9000 |
52 <link doc="ngx_stream_module.xml" id="proxy_pass">proxies</link> | 53 <link id="proxy_pass">proxies</link> |
53 TCP connections to a group of servers named <literal>backend</literal>. | 54 TCP connections to a group of servers named <literal>backend</literal>. |
54 Note that the <link doc="ngx_stream_module.xml" id="proxy_pass"/> | 55 Note that the <link id="proxy_pass"/> |
55 directive defined the context of the <literal>stream</literal> module | 56 directive defined in the <link id="stream"/> context |
56 must not contain a protocol. | 57 must not contain a protocol. |
57 Two optional timeout parameters are specified: | 58 Two optional timeout parameters are specified: |
58 the <link doc="ngx_stream_module.xml" id="proxy_connect_timeout"/> sets | 59 the <link id="proxy_connect_timeout"/> sets |
59 a timeout required for establishing a connection with a server | 60 a timeout required for establishing a connection with a server |
60 that belongs to the <literal>backend</literal> group, while the | 61 that belongs to the <literal>backend</literal> group, while the |
61 <link doc="ngx_stream_module.xml" id="proxy_timeout"/> sets | 62 <link id="proxy_timeout"/> sets |
62 a timeout used after proxying to one of the servers in the | 63 a timeout used after proxying to one of the servers in the |
63 <literal>backend</literal> group had started. | 64 <literal>backend</literal> group had started. |
64 All TCP proxy-related functionality is configured inside the | 65 All TCP proxy-related functionality is configured inside the |
65 <link doc="ngx_stream_module.xml" id="stream"/> block | 66 <link id="stream"/> block |
66 just like the <link doc="../http/ngx_http_core_module.xml" id="http"/> block | 67 just like the <link doc="../http/ngx_http_core_module.xml" id="http"/> block |
67 for HTTP requests. | 68 for HTTP requests. |
68 </para> | 69 </para> |
69 | 70 |
70 <para> | 71 <para> |
71 The <literal>backend</literal> group consists of three physical servers | 72 The <literal>backend</literal> group consists of three physical servers |
72 (<literal>srv1-srv3</literal>). | 73 (<literal>srv1-srv3</literal>). |
73 Each server name follows the obligatory <literal>port</literal> number. | 74 Each server name follows the obligatory port number. |
74 TCP connections are distributed among the servers according to the | 75 TCP connections are distributed among the servers according to the |
75 <link doc="ngx_stream_upstream_module.xml" id="least_conn">least | 76 <link doc="ngx_stream_upstream_module.xml" id="least_conn">least |
76 connected</link> load balancing method: a connection will go to the server | 77 connected</link> load balancing method: a connection will go to the server |
77 that has the fewest active connections. | 78 that has the least number of active connections. |
78 Directives required to configure a group of proxied servers | 79 Directives required to configure a group of proxied servers |
79 and load-balancing can be found in the | 80 and load-balancing can be found in the |
80 <link doc="ngx_stream_upstream_module.xml">ngx_stream_upstream_module</link>. | 81 <link doc="ngx_stream_upstream_module.xml">ngx_stream_upstream_module</link> |
82 module. | |
81 </para> | 83 </para> |
82 | 84 |
83 </section> | 85 </section> |
84 | 86 |
85 | 87 |
219 | 221 |
220 </directive> | 222 </directive> |
221 | 223 |
222 | 224 |
223 <directive name="proxy_pass"> | 225 <directive name="proxy_pass"> |
224 <syntax><value>URL</value></syntax> | 226 <syntax><value>address</value></syntax> |
225 <default/> | 227 <default/> |
226 <context>server</context> | 228 <context>server</context> |
227 | 229 |
228 <para> | 230 <para> |
229 Sets the address of a proxied server or a | 231 Sets the address of a proxied server. |
230 <link doc="ngx_stream_upstream_module.xml">server group</link>. | |
231 The address can be specified as a domain name or IP address, | 232 The address can be specified as a domain name or IP address, |
232 and an obligatory port. | 233 and an obligatory port: |
234 <example> | |
235 proxy_pass localhost:8000; | |
236 </example> | |
237 or as a UNIX-domain socket path: | |
238 <example> | |
239 proxy_pass unix:/tmp/stream.socket; | |
240 </example> | |
241 </para> | |
242 | |
243 <para> | |
233 If a domain name resolves to several addresses, all of them will be | 244 If a domain name resolves to several addresses, all of them will be |
234 used in a round-robin fashion. | 245 used in a round-robin fashion. |
246 In addition, an address can be specified as a | |
247 <link doc="ngx_stream_upstream_module.xml">server group</link>. | |
235 </para> | 248 </para> |
236 | 249 |
237 </directive> | 250 </directive> |
238 | 251 |
239 | 252 |