From ebc7cc85c0969d71598bb9d87af35b2b2895ad81 Mon Sep 17 00:00:00 2001 From: bjdgyc Date: Wed, 11 Oct 2023 16:00:53 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0nginx=20stream=E7=A4=BA?= =?UTF-8?q?=E4=BE=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- doc/question.md | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/doc/question.md b/doc/question.md index 190da8a..82334c2 100644 --- a/doc/question.md +++ b/doc/question.md @@ -46,6 +46,34 @@ stream { } ``` +> nginx实现 共用443端口 示例 + +```conf +stream { + map $ssl_preread_server_name $name { + vpn.xx.com myvpn; + default defaultpage; + } + + # upstream pool + upstream myvpn { + server 127.0.0.1:8443; + } + upstream defaultpage { + server 127.0.0.1:8080; + } + + server { + listen 443 so_keepalive=on; + ssl_preread on; + #接收端也需要设置 proxy_protocol + #proxy_protocol on; + proxy_pass $name; + } +} + +``` + ### 性能问题 ``` 内网环境测试数据