Repository navigation
Expand file tree
/
Copy pathCaddyfile
More file actions
87 lines (75 loc) · 1.64 KB
/
Copy pathCaddyfile
File metadata and controls
87 lines (75 loc) · 1.64 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
78
79
80
81
82
83
84
85
86
87
{
servers {
protocols h1 h2
}
log default {
output file /var/log/caddy/error.log {
mode 0640
roll_size 100MiB
roll_keep 10
roll_keep_for 720h
}
format json
level ERROR
}
}
http://127.0.0.1:8080 {
route {
handle /healthz {
root * /srv
rewrite * /index.html
file_server
}
handle {
respond 404
}
}
}
{$SITE_ADDRESS:jiying.chat} {
encode zstd gzip
log {
output file /var/log/caddy/access.log {
mode 0640
roll_size 100MiB
roll_keep 10
roll_keep_for 720h
}
format json
}
@immutable path /_astro/*
header @immutable Cache-Control "public, max-age=31536000, immutable"
@releaseManifest path /releases/version.json
header @releaseManifest {
Access-Control-Allow-Origin "*"
Cache-Control "no-store, no-cache, must-revalidate"
}
@releasePackages path /releases/jiying.exe /releases/jiying.dmg /releases/jiying.amd.AppImage /releases/jiying.arm.AppImage /releases/jiying.apk
header @releasePackages Cache-Control "no-cache"
# AASA 没有扩展名,显式声明 JSON,否则 iOS 可能拒绝解析。
@aasa path /.well-known/apple-app-site-association
header @aasa Content-Type application/json
header {
Referrer-Policy "strict-origin-when-cross-origin"
X-Content-Type-Options "nosniff"
X-Frame-Options "DENY"
}
route {
handle /healthz {
respond "ok" 200
}
handle_path /releases/* {
root * /srv/releases
file_server
}
# 兼容无尾斜杠的旧链接:直接返回页面而不是 308,避免丢掉配对 query。
handle /app-link/scan {
root * /srv
rewrite * /app-link/scan/index.html
file_server
}
handle {
root * /srv
file_server
}
}
}