支持同机双域名部署选号网hfb_show
Caddy按CADDY_SHOW_DOMAIN托管选号网静态并反代API;一键脚本可构建hfb_show并写入配置。
This commit is contained in:
@@ -0,0 +1,35 @@
|
||||
# 由 scripts/deploy-prod.sh 根据 CADDY_SHOW_DOMAIN 生成到 conf.d/show.caddy
|
||||
# 选号网静态页 + 同源 /api 反代到 hfb_sys backend(本机 Docker 网络,非公网绕行)
|
||||
|
||||
__CADDY_SHOW_DOMAIN__ {
|
||||
encode zstd gzip
|
||||
|
||||
header {
|
||||
Strict-Transport-Security "max-age=31536000"
|
||||
X-Content-Type-Options "nosniff"
|
||||
X-Frame-Options "SAMEORIGIN"
|
||||
Referrer-Policy "strict-origin-when-cross-origin"
|
||||
}
|
||||
|
||||
# 与主站共用后端公开接口;浏览器访问选号网域名下的 /api/* 即可,无需跨域。
|
||||
handle /api/* {
|
||||
request_body {
|
||||
max_size 11MB
|
||||
}
|
||||
reverse_proxy backend:8080 {
|
||||
header_up X-Real-IP {remote_host}
|
||||
}
|
||||
}
|
||||
|
||||
handle /health {
|
||||
reverse_proxy backend:8080 {
|
||||
header_up X-Real-IP {remote_host}
|
||||
}
|
||||
}
|
||||
|
||||
handle {
|
||||
root * /srv/show-dist
|
||||
try_files {path} /index.html
|
||||
file_server
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user