forked from lxhao61/integrated-examples
-
Notifications
You must be signed in to change notification settings - Fork 0
/
trojan-go_caddy.json
63 lines (63 loc) · 1.91 KB
/
trojan-go_caddy.json
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
{
"admin": {
"disabled": true
},
"logging": {
"logs": {
"default": {
"level": "ERROR",
"writer": {
"output": "file",
"filename": "/var/log/caddy/access.log"
}
}
}
},
"apps": {
"http": {
"servers": {
"trojan": {
"listen": [":443"], //https默认监听端口
"listener_wrappers": [{
"wrapper": "trojan" //caddy-trojan插件应用必须配置
}],
"routes": [{
"handle": [{
"handler": "trojan",
"users": ["diy443"], //更改为自己的密码。密码可多组("password"),用逗号隔开。
"connect_method": true,
"websocket": true //开启Websocket支持
}]
},
{
"match": [{
"host": ["xx.yy"] //限定域名访问(禁止以ip方式访问网站),更改为自己的域名。
}],
"handle": [{
"handler": "headers",
"response": {
"set": {
"Strict-Transport-Security": ["max-age=31536000; includeSubDomains; preload"] //启用HSTS
}
}
},
{
"handler": "file_server",
"root": "/var/www/html" //更改为自己存放的web文件路径
}]
}],
"tls_connection_policies": [{
"cipher_suites": ["TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384","TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256","TLS_ECDHE_ECDSA_WITH_CHACHA20_POLY1305_SHA256"],
"alpn": ["h2","http/1.1"]
}],
"allow_h2c": true //caddy-trojan插件应用必须启用
}
}
},
"tls": {
"certificates": {
"automate": ["xx.yy"] //自动化管理域名证书(包括获取、更新证书及加载证书)。更改为自己的域名。
}
}
}
}