- Integrate @astrojs/sitemap for automatic sitemap generation - Add robots.txt with sitemap reference - Add Open Graph and Twitter Card meta tags to Layout - Add canonical URL and structured data slot to Layout - Add JSON-LD schema (WebSite, CollectionPage, Book, BreadcrumbList) - Create custom 404 page with navigation links - Create default OG image (SVG with graph-paper theme) - Wire SITE_URL through Docker build args for production builds - Update Caddyfile for proper 404 handling instead of SPA fallback
31 lines
723 B
Caddyfile
31 lines
723 B
Caddyfile
:4321 {
|
|
root * /srv
|
|
file_server
|
|
|
|
# Handle clean URLs - try file, then directory, then .html extension
|
|
try_files {path} {path}/ {path}.html
|
|
|
|
# Custom 404 page
|
|
handle_errors {
|
|
rewrite * /404.html
|
|
file_server
|
|
}
|
|
|
|
# Compression
|
|
encode gzip
|
|
|
|
# Service worker must not be cached
|
|
@sw path /sw.js
|
|
header @sw Cache-Control "no-cache, no-store, must-revalidate"
|
|
|
|
# Cache static assets
|
|
@static {
|
|
path *.jpg *.jpeg *.png *.gif *.ico *.css *.js *.pdf *.svg *.woff *.woff2
|
|
}
|
|
header @static Cache-Control "public, max-age=604800, immutable"
|
|
|
|
# Security headers
|
|
header X-Frame-Options "SAMEORIGIN"
|
|
header X-Content-Type-Options "nosniff"
|
|
}
|