31 lines
750 B
Caddyfile
31 lines
750 B
Caddyfile
# Caddy 自动申请并续期证书,不用自己跑 certbot。
|
|
# 域名解析到这台服务器、80/443 放行即可;国内服务器要先完成 ICP 备案。
|
|
|
|
{$SITE_DOMAIN} {
|
|
encode zstd gzip
|
|
|
|
# 反代到容器里的 app(compose 网络内用服务名)
|
|
reverse_proxy app:8000
|
|
|
|
header {
|
|
# 安全响应头:这几个不影响功能,但漏了会被扫描器标出来
|
|
Strict-Transport-Security "max-age=31536000; includeSubDomains"
|
|
X-Content-Type-Options "nosniff"
|
|
X-Frame-Options "SAMEORIGIN"
|
|
Referrer-Policy "strict-origin-when-cross-origin"
|
|
-Server
|
|
}
|
|
|
|
# 上传的卷子照片最多 12MB,留点余量
|
|
request_body {
|
|
max_size 16MB
|
|
}
|
|
|
|
log {
|
|
output file /data/access.log {
|
|
roll_size 20mb
|
|
roll_keep 5
|
|
}
|
|
}
|
|
}
|