Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
nginx
GitHub Repository: nginx/nginx.org
Path: blob/main/xml/en/docs/stream/ngx_stream_pass_module.xml
1 views
1
<?xml version="1.0"?>
2
3
<!--
4
Copyright (C) Nginx, Inc.
5
-->
6
7
<!DOCTYPE module SYSTEM "../../../../dtd/module.dtd">
8
9
<module name="Module ngx_stream_pass_module"
10
link="/en/docs/stream/ngx_stream_pass_module.html"
11
lang="en"
12
rev="1">
13
14
<section id="summary">
15
16
<para>
17
The <literal>ngx_stream_pass_module</literal> module (1.25.5) allows
18
passing the accepted connection directly to any configured listening socket
19
in <literal>http</literal>, <literal>stream</literal>, <literal>mail</literal>,
20
and other similar modules.
21
</para>
22
23
</section>
24
25
26
<section id="example" name="Example Configuration">
27
28
<para>
29
<example>
30
http {
31
server {
32
listen 8000;
33
34
location / {
35
root html;
36
}
37
}
38
}
39
40
stream {
41
server {
42
listen 12345 ssl;
43
44
ssl_certificate domain.crt;
45
ssl_certificate_key domain.key;
46
47
pass 127.0.0.1:8000;
48
}
49
}
50
</example>
51
In the example,
52
after terminating SSL/TLS in the <literal>stream</literal> module
53
the connection is passed to the <literal>http</literal> module.
54
</para>
55
56
</section>
57
58
59
<section id="directives" name="Directives">
60
61
<directive name="pass">
62
<syntax><value>address</value></syntax>
63
<default/>
64
<context>server</context>
65
66
<para>
67
Sets server address to pass client connection to.
68
The address can be specified as an IP address
69
and a port:
70
<example>
71
pass 127.0.0.1:12345;
72
</example>
73
or as a UNIX-domain socket path:
74
<example>
75
pass unix:/tmp/stream.socket;
76
</example>
77
</para>
78
79
<para>
80
The address can also be specified using variables:
81
<example>
82
pass $upstream;
83
</example>
84
</para>
85
86
</directive>
87
88
</section>
89
90
</module>
91
92