-
Notifications
You must be signed in to change notification settings - Fork 64
Expand file tree
/
Copy pathCaddyfile
More file actions
44 lines (39 loc) · 1.36 KB
/
Copy pathCaddyfile
File metadata and controls
44 lines (39 loc) · 1.36 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
# ── 宿主机 Caddy(生产推荐)────────────────────────────────────────
# TLS 终结 + 路由:
# /api、/health、/ws、Arena 旧路径 → backend :8765(含 Doctor WebSocket)
# 其余(SPA 静态) → frontend :8080
#
# 前置:docker compose 将 backend 绑到 127.0.0.1:8765(见 docker-compose.yml)
# 安装:合并进 /etc/caddy/Caddyfile 后 `sudo caddy validate` + `sudo systemctl reload caddy`
#
# 说明:frontend 容器内 nginx 仍可作「无宿主机反代」时的兜底;有本 Caddy 时 API/WS
# 不再经过 nginx,避免双层代理漏 Upgrade。
www.skilllite.ai {
encode gzip
header {
Strict-Transport-Security "max-age=31536000; includeSubDomains; preload"
X-Content-Type-Options "nosniff"
X-Frame-Options "SAMEORIGIN"
Referrer-Policy "strict-origin-when-cross-origin"
}
# Backend API + WebSocket(Caddy 自动透传 Upgrade)
@backend {
path /api/* /health /ws /ws/*
path /agents* /tasks* /config* /dispatcher* /monitor* /replay* /chronicle* /teams* /snapshot*
}
handle @backend {
reverse_proxy 127.0.0.1:8765 {
header_up X-Real-IP {remote_host}
}
}
# SPA / 静态资源
handle {
reverse_proxy 127.0.0.1:8080 {
header_up X-Real-IP {remote_host}
}
}
log {
output stdout
format console
}
}