forked from lxhao61/integrated-examples
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCaddyfile
38 lines (35 loc) · 1.33 KB
/
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
35
36
37
38
{
order reverse_proxy before route
admin off
log {
output file /var/log/caddy/error.log
level ERROR
} #版本不小于v2.4.0才支持日志全局配置,否则各自配置。
email [email protected] #电子邮件地址。选配,推荐。
}
:443, xx.yy { #xx.yy修改为自己的域名。注意:逗号与域名之间有一个空格。
tls {
ciphers TLS_AES_256_GCM_SHA384 TLS_AES_128_GCM_SHA256 TLS_CHACHA20_POLY1305_SHA256 TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384 TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256 TLS_ECDHE_ECDSA_WITH_CHACHA20_POLY1305_SHA256
curves x25519 secp521r1 secp384r1 secp256r1
alpn http/1.1 h2
}
@sws {
header Connection *Upgrade*
header Upgrade websocket
path /8ALdGZ9k #与shadowsocks+ws应用中path对应
}
reverse_proxy @sws 127.0.0.1:2008 #转发给本机shadowsocks+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文件路径
}
}
}
#备注:
#1、本配置仅支持申请普通TLS证书,若要申请通配符TLS证书请参考‘caddy(other configuration) (Caddy的特殊应用配置方法。)’中对应介绍及对应配置示例。