-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCaddyfile
More file actions
49 lines (41 loc) · 1.65 KB
/
Copy pathCaddyfile
File metadata and controls
49 lines (41 loc) · 1.65 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
# ─────────────────────────────────────────────────────────────────
# Ployer — Caddy reverse proxy configuration
#
# Replace "your-staging-domain.com" with your actual domain.
# Caddy automatically provisions TLS via Let's Encrypt.
# ─────────────────────────────────────────────────────────────────
your-staging-domain.com {
# Proxy everything (API + frontend) to the Ployer container.
# Ployer serves its own static frontend on the same port.
reverse_proxy ployer:3001
# Pass real client IP to the backend
header_up X-Real-IP {remote_host}
header_up X-Forwarded-Proto {scheme}
# WebSocket upgrade support (for /api/v1/ws)
@websocket {
header Connection *Upgrade*
header Upgrade websocket
}
reverse_proxy @websocket ployer:3001
# Access log
log {
output file /data/caddy/access.log
format json
}
}
# LAN / direct-IP access (HTTP only — no cert possible for private IPs).
# Catches any host not matched above (e.g. http://192.168.x.x, http://hostname.local).
http:// {
reverse_proxy ployer:3001
header_up X-Real-IP {remote_host}
header_up X-Forwarded-Proto {scheme}
@websocket {
header Connection *Upgrade*
header Upgrade websocket
}
reverse_proxy @websocket ployer:3001
}
# Caddy Admin API — keep internal only (bind to all so ployer container can reach it)
:2019 {
bind 0.0.0.0
}