forked from anomalyco/models.dev
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCaddyfile
More file actions
28 lines (24 loc) · 885 Bytes
/
Caddyfile
File metadata and controls
28 lines (24 loc) · 885 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
# Caddyfile — models.dev self-hosted
# Caddy automatically obtains and renews TLS certificates via Let's Encrypt.
# Set the DOMAIN environment variable or replace the placeholder directly.
{$DOMAIN:your-domain.com} {
# Reverse proxy everything to the Bun server
reverse_proxy localhost:3000 {
# Pass real client IP to the Bun server
header_up X-Forwarded-For {remote_host}
header_up X-Forwarded-Proto {scheme}
}
# Compress responses
encode gzip zstd
# Cache static assets aggressively (JS/CSS have hashed filenames)
@static {
path *.js *.css *.svg *.png *.ico *.woff2
}
header @static Cache-Control "public, max-age=31536000, immutable"
# Security headers
header {
X-Content-Type-Options nosniff
X-Frame-Options SAMEORIGIN
Referrer-Policy strict-origin-when-cross-origin
}
}