mirror of
https://github.com/Shik3i/KoalaSync.git
synced 2026-07-26 20:18:14 +00:00
47 lines
1.6 KiB
Caddyfile
47 lines
1.6 KiB
Caddyfile
# KoalaSync - Production Caddy Configuration Example
|
|
# Replace domains and paths with your actual setup.
|
|
|
|
# 1. Marketing Website & Invitation Bridge
|
|
sync.koalastuff.net {
|
|
root * /var/www/koalasync/website
|
|
file_server
|
|
encode zstd gzip
|
|
|
|
# Static Caching for high-performance PageSpeed (1 year with validation)
|
|
@static {
|
|
file
|
|
path *.ico *.css *.js *.png *.svg *.webp
|
|
}
|
|
header @static Cache-Control "public, max-age=31536000, must-revalidate"
|
|
|
|
# Security Headers & Content Security Policy (CSP)
|
|
header {
|
|
# Strict Content Security Policy (restricts scripts and connections to self, forbids frames)
|
|
Content-Security-Policy "default-src 'self'; script-src 'self'; style-src 'self' 'unsafe-inline'; connect-src 'self'; img-src 'self' data:; object-src 'none'; frame-ancestors 'none';"
|
|
# Prevent FLoC tracking
|
|
Permissions-Policy interest-cohort=()
|
|
# Security best practices
|
|
Strict-Transport-Security "max-age=31536000; includeSubDomains; preload"
|
|
X-Content-Type-Options nosniff
|
|
X-Frame-Options DENY
|
|
Referrer-Policy no-referrer-when-downgrade
|
|
}
|
|
}
|
|
|
|
# 2. Relay Server (Socket.IO / WebSocket)
|
|
syncserver.koalastuff.net {
|
|
reverse_proxy localhost:3000 {
|
|
# Ensure WebSocket support is explicitly handled if needed
|
|
# (Caddy usually handles this automatically)
|
|
header_up Host {host}
|
|
header_up X-Real-IP {remote_host}
|
|
}
|
|
|
|
# Security Headers for the relay
|
|
header {
|
|
X-Content-Type-Options nosniff
|
|
X-Frame-Options DENY
|
|
Referrer-Policy no-referrer
|
|
}
|
|
}
|