Caddy: Add option to have a separate Admin domain

- Our setup docs recommend having Ghost Admin on a separate domain from the content domain
- This lets users optionally set this up if they want whilst continuing to align Admin <-> content domain through templates
This commit is contained in:
James Loh
2025-07-15 16:22:58 +10:00
parent b2a3d75490
commit ceac2ed1c2
4 changed files with 41 additions and 12 deletions

View File

@@ -17,20 +17,31 @@
encode gzip
# Optional: Add security headers
header {
# Enable HSTS
Strict-Transport-Security max-age=31536000;
# Prevent embedding in frames
X-Frame-Options DENY
# Enable XSS protection
X-XSS-Protection "1; mode=block"
# Prevent MIME sniffing
X-Content-Type-Options nosniff
# Referrer policy
Referrer-Policy strict-origin-when-cross-origin
}
import snippets/SecurityHeaders
}
# If you have a separate domain for Ghost Admin uncomment the below block
# {$ADMIN_DOMAIN} {
# import snippets/Logging
#
# # Traffic Analytics service
# import snippets/TrafficAnalytics
#
# # ActivityPub Service
# import snippets/ActivityPub
#
# # Default proxy everything else to Ghost
# handle {
# reverse_proxy ghost:2368
# }
#
# # Optional: Enable gzip compression
# encode gzip
#
# # Optional: Add security headers
# import snippets/SecurityHeaders
# }
# If you want to redirect the www variant of your domain to the non-www varient uncomment the below 4 lines
# Note: You must have DNS setup correctly for this to work
# www.{$DOMAIN} {