nginx 中转配置
stream {
map $ssl_preread_server_name $name {
99web.domain.com localweb;
99tj.domain.com localtrojan;
99vs.domain.com 127.0.0.1:10443;
99ifog.domain.com 127.0.0.1:10444;
default web;
}
upstream dns_upstreams {
server 83.138.53.22x:446;
}
upstream localweb {
server 127.0.0.1:444;
}
upstream localtrojan {
server 127.0.0.1:441;
}
upstream localtrojan2 {
server 127.0.0.1:442;
}
server{
listen 10446 udp;
proxy_pass dns_upstreams;
}
server {
listen 443;
listen [::]:443;
proxy_pass $name;
ssl_preread on;
proxy_protocol on;
}
server {
listen 127.0.0.1:441 proxy_protocol;
proxy_pass localtrojan2;
}
server {
listen 127.0.0.1:10443 proxy_protocol ssl;
ssl_certificate /www/server/panel/vhost/cert/99.domain.com/fullchain.pem;
ssl_certificate_key /www/server/panel/vhost/cert/99.domain.com/privkey.pem;
proxy_ssl on;
proxy_ssl_server_name on;
proxy_pass gia.domain.com:443;
}
server {
listen 127.0.0.1:10444 proxy_protocol ssl;
ssl_certificate /www/server/panel/vhost/cert/99.domain.com/fullchain.pem;
ssl_certificate_key /www/server/panel/vhost/cert/99.domain.com/privkey.pem;
proxy_ssl on;
proxy_ssl_server_name on;
proxy_pass ifog.domain.com:443;
}
}