-
Notifications
You must be signed in to change notification settings - Fork 161
Expand file tree
/
Copy pathCaddyfile.ladle
More file actions
42 lines (34 loc) · 827 Bytes
/
Caddyfile.ladle
File metadata and controls
42 lines (34 loc) · 827 Bytes
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
{
admin off
}
:{$PORT:80} {
# Health check endpoint (must come before file_server)
handle /health {
respond "healthy" 200
}
# Main site handler
handle {
root * /srv
# Gzip compression
encode gzip
# Security headers
header {
X-Frame-Options "SAMEORIGIN"
X-Content-Type-Options "nosniff"
X-XSS-Protection "1; mode=block"
}
# Cache static assets aggressively
@static {
path *.js *.css *.png *.jpg *.jpeg *.gif *.ico *.svg *.woff *.woff2 *.ttf *.eot
}
header @static Cache-Control "public, max-age=31536000, immutable"
# Don't cache HTML files (for SPA updates)
@html {
path *.html
}
header @html Cache-Control "no-store, no-cache, must-revalidate"
# SPA catch-all routing - try file first, then fall back to index.html
try_files {path} /index.html
file_server
}
}