-
Notifications
You must be signed in to change notification settings - Fork 403
/
1_nginx.conf
45 lines (35 loc) · 1.19 KB
/
1_nginx.conf
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
user root;
worker_processes auto;
error_log /var/log/nginx/error.log;
pid /run/nginx.pid;
events {
worker_connections 1024;
}
stream {
map $ssl_preread_server_name $backend_name {
zv.xx.yy vless; #zv.xx.yy更改为自己规划对应vless+tcp+tls的域名
zt.xx.yy trojan; #zt.xx.yy更改为自己规划对应trojan+tcp+tls的域名
zh.xx.yy https; #zh.xx.yy更改为自己规划对应https server的域名
}
upstream vless {
server 127.0.0.1:8443; #转给vless+tcp+tls本地监听端口
}
upstream trojan {
server 127.0.0.1:6443; #转给trojan+tcp+tls本地监听端口
}
upstream https {
server 127.0.0.1:7443; #转给https server本地监听端口
}
server {
listen 443; #IPv4,tcp 443监听端口。
listen [::]:443; #IPv6,tcp 443监听端口。无IPv6,此项可以删除。
ssl_preread on;
proxy_pass $backend_name;
}
server {
listen 443 udp; #IPv4,udp 443监听端口。
listen [::]:443 udp; #IPv6,udp 443监听端口。无IPv6,此项可以删除。
proxy_timeout 20s;
proxy_pass 127.0.0.1:7443; #转给https server本地监听端口
}
}