负载均衡终于整上了,接下来该弄qb代理了

This commit is contained in:
2026-06-30 13:52:46 +08:00
parent d5d02f65c4
commit 58f6a2a67f
4 changed files with 145 additions and 117 deletions
+28 -11
View File
@@ -1,19 +1,27 @@
stream {
resolver 223.5.5.5;
# === 端口 443Nginx SNI 分流 ===
map $ssl_preread_server_name $backend {
www.apple.com xray; # 旁路由反向代理隧道
www.microsoft.com mihomo; # 新增:mihomo出站流量
news.apple.com xray_lan; # 新增:旁路由代理直连流量
drive.salmonstill.cn nas; # 绿联云服务
default npm; # Nginx Proxy Manager
www.samsung.com xray;
addons.mozilla.org xray;
www.apple.com xray;
news.apple.com xray_lan;
drive.salmonstill.cn nas;
default npm;
}
# === 端口 9447Reality 回落数据中心 ===
map $ssl_preread_server_name $fallback {
www.samsung.com www.samsung.com:443;
addons.mozilla.org addons.mozilla.org:443;
www.apple.com www.apple.com:443;
default 127.0.0.1:1;
}
upstream xray {
server 127.0.0.1:9443;
}
# 新增mihomo upstream
upstream mihomo {
server 127.0.0.1:9444;
}
# 旁路由代理直连
upstream xray_lan {
server 127.0.0.1:9445;
}
@@ -23,10 +31,19 @@ stream {
upstream npm {
server 127.0.0.1:8443;
}
server {
listen 443 reuseport;
listen [::]:443 reuseport;
ssl_preread on;
proxy_pass $backend;
}
}
server {
listen 127.0.0.1:9447;
ssl_preread on;
proxy_pass $fallback;
proxy_download_rate 1m;
proxy_upload_rate 512k;
}
}