Files
yml2213 0d3543fd4b 部署默认端口改为 18080,支持与宿主机 Caddy 共存
避免与已有 80/443 服务冲突;补充端口检测、Caddyfile 示例与文档说明。
2026-07-15 15:38:07 +08:00

41 lines
1.2 KiB
Caddyfile
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# 与现有 Caddy 共存:把本段并入宿主机 Caddy 配置后 reload
# 前提:kefu_cloud 已部署,deploy/.env.prod 中 HTTP_PORT=18080(或你改的其它端口)
#
# 拓扑:
# Internet → Caddy :80/:443 → 127.0.0.1:18080 → kefu-cloud-web(Nginx)
# 旧站(如 kefu_sys)保持原有 site 块不变
# ---------- 方式 A:独立域名(推荐)----------
kefu.example.com {
# 自动 HTTPSLet's Encrypt);内网调试可改用 :80 + reverse_proxy
encode gzip
reverse_proxy 127.0.0.1:18080 {
# WebSocket/api/ws、/api/widget/ws)与长连接
flush_interval -1
transport http {
read_timeout 3600s
write_timeout 3600s
}
}
}
# ---------- 方式 B:与旧站同机、仅 HTTP 调试(无证书)----------
# :18081 {
# reverse_proxy 127.0.0.1:18080
# }
# ---------- 方式 C:路径分流同一域名(少用,路径易与旧站冲突)----------
# example.com {
# handle_path /cloud/* {
# reverse_proxy 127.0.0.1:18080
# }
# handle {
# reverse_proxy kefu_sys:8080
# }
# }
# 应用配置后:
# caddy validate --config /path/to/Caddyfile
# caddy reload --config /path/to/Caddyfile
# 或 dockerdocker exec caddy caddy reload --config /etc/caddy/Caddyfile