-
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.06 KB
/
Copy pathCaddyfile
File metadata and controls
49 lines (41 loc) · 1.06 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
# Caddyfile for nxtchess
# Set DOMAIN env var in production (e.g., DOMAIN=chess.example.com), defaults to localhost
{$DOMAIN:localhost} {
# Frontend - serve the SPA
handle {
reverse_proxy frontend:80
}
# Backend API
handle /api/* {
reverse_proxy backend:8080
}
# Backend health checks
handle /health* {
reverse_proxy backend:8080
}
# Backend auth routes
handle /auth/* {
reverse_proxy backend:8080
}
# WebSocket for multiplayer
handle /ws {
reverse_proxy backend:8080
}
# Security headers
header {
X-Frame-Options "SAMEORIGIN"
X-Content-Type-Options "nosniff"
X-XSS-Protection "1; mode=block"
Referrer-Policy "strict-origin-when-cross-origin"
# Required for SharedArrayBuffer (Stockfish WASM)
Cross-Origin-Opener-Policy "same-origin"
Cross-Origin-Embedder-Policy "credentialless"
}
# Enable compression
encode gzip zstd
# Logging
log {
output stdout
format console
}
}