-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCaddyfile
More file actions
65 lines (54 loc) · 1.63 KB
/
Caddyfile
File metadata and controls
65 lines (54 loc) · 1.63 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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
backgammon.beatty.codes, doublecube.gg {
# Client configuration endpoint (served by WebClient for service discovery)
handle /api/config {
reverse_proxy webclient:3000 {
header_up Host {host}
header_up X-Real-IP {remote_host}
}
}
# Server API endpoints
handle /api/* {
reverse_proxy server:5000
}
# SignalR WebSocket endpoint
handle /gamehub* {
reverse_proxy server:5000 {
header_up Host {host}
header_up X-Real-IP {remote_host}
# WebSocket upgrade headers (critical for SignalR)
header_up Upgrade {http.request.header.Upgrade}
header_up Connection {http.request.header.Connection}
# Force HTTP/1.1 for WebSocket support
transport http {
versions 1.1
read_timeout 10m
write_timeout 10m
dial_timeout 30s
response_header_timeout 30s
}
# Disable buffering for SSE/WebSocket keepalive
flush_interval -1
}
}
# Health check endpoints
handle /health {
reverse_proxy server:5000
}
handle /alive {
reverse_proxy server:5000
}
handle /stats {
reverse_proxy server:5000
}
# WebClient - Serve static content (catch-all, must be last)
handle /* {
reverse_proxy webclient:3000
}
# Enable automatic HTTPS
tls {$TLS_EMAIL:admin@example.com}
# Enable access logging
log {
output stdout
format console
}
}