forked from lxhao61/integrated-examples
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path2_Caddyfile
34 lines (31 loc) · 1.11 KB
/
2_Caddyfile
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
{
order reverse_proxy before map
admin off
log { #注意:版本不小于v2.4.0才支持日志全局配置,否则各自配置。
output file /var/log/caddy/access.log
level ERROR
}
}
:443, xx.yy { #xx.yy更改为自己的域名。注意:逗号与域名之间有一个空格。
tls {
ciphers TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384 TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256 TLS_ECDHE_ECDSA_WITH_CHACHA20_POLY1305_SHA256
alpn http/1.1 h2
}
@vws { #匹配器标签。此标签仅区分,多个不同代理需要改成不同名称,但要与下边‘reverse_proxy’中匹配器标签对应。
path /HALdGZ9k #与vless+ws或vmess+ws应用中path对应
header Connection *Upgrade*
header Upgrade websocket
}
reverse_proxy @vws unix//dev/shm/vws.sock #转发给本机vless+ws或vmess+ws监听进程
@host {
host xx.yy #限定域名访问(禁止以ip方式访问网站),更改为自己的域名。
}
route @host {
header {
Strict-Transport-Security "max-age=31536000; includeSubDomains; preload" #启用HSTS
}
file_server {
root /var/www/html #更改为自己存放的web文件路径
}
}
}