-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathnginx.conf
More file actions
77 lines (67 loc) · 1.89 KB
/
Copy pathnginx.conf
File metadata and controls
77 lines (67 loc) · 1.89 KB
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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
load_module /usr/local/nginx/modules/ngx_stream_module.so;
worker_processes 1;
events {
worker_connections 1024;
}
stream {
map $ssl_preread_server_name $name {
trojan.domain.com 127.0.0.1:555; #forward to trojan
aria2.domain.com 127.0.0.1:6801; #forward to aria2_rpc
default 127.0.0.1:4433; #block all
}
server {
listen 443 reuseport;
listen [::]:443 reuseport;
proxy_pass $name;
ssl_preread on; #开启 ssl_preread
}
}
http {
include mime.types;
default_type application/octet-stream;
sendfile on;
keepalive_timeout 65;
###全站https
server {
listen 0.0.0.0:80;
listen [::]:80;
server_name _;
return 301 https://$host$request_uri;
}
server {
listen 4433 default ssl;
server_name _;
return 403; #block all
ssl_certificate /etc/trojan/full_chain.pem;
ssl_certificate_key /etc/trojan/private.key;
ssl_session_cache shared:SSL:1m;
ssl_session_timeout 5m;
ssl_ciphers HIGH:!aNULL:!MD5;
ssl_prefer_server_ciphers on;
location / {
root html;
index index.html index.htm;
}
}
server {
listen 127.0.0.1:6801 ssl;
server_name _;
ssl_certificate /etc/trojan/full_chain.pem;
ssl_certificate_key /etc/trojan/private.key;
location / {
proxy_pass http://127.0.0.1:6800;
}
}
##Trojan伪装站点
server {
listen 127.0.0.1:5555 http2;
server_name _;
charset utf-8;
absolute_redirect off;
ssl_certificate /etc/trojan/full_chain.pem;
ssl_certificate_key /etc/trojan/private.key;
location / {
index index.html;
}
}
}