@
falcon05 stream {
#$ssl_preread_server_name #通过 SNI 请求的服务器名称
map $ssl_preread_server_name $ssl_server {
deaflut ssh;
trojan.xx.xx trojan_ssl;
web.xx.xx web_ssl;
}
upstream ssh{
server 127.0.0.1:22;
}
upstream trojan_ssl{
server 172.18.0.2:443;
}
upstream web_ssl{
server 172.18.0.3:443;
}
server {
listen 443;
ssl_preread on; #允许在预读阶段从 ClientHello 消息中提取信息
#resolver 8.8.8.8;
proxy_pass $ssl_server;
proxy_connect_timeout 5s;
#error_log /data/logs/stream_ssl_preread.log info;
}
}