mirror of
https://github.com/d0zingcat/ghost-docker.git
synced 2026-05-30 07:26:45 +00:00
Caddy: Move to more templated approach
no ref - The goal here is to be able to provide more functionality to self-hosters through snippets and other segmented config - Some customers run Admin <-> content domains on separate ones which our current config doesn't support - Our current config also hardcodes a www redirect which complicates setups when you don't have that domain setup or don't even want it - Moving to a default template customers will have to copy which includes snippets allows us to update these later on without breaking peoples setups
This commit is contained in:
38
caddy/Caddyfile.example
Normal file
38
caddy/Caddyfile.example
Normal file
@@ -0,0 +1,38 @@
|
||||
# Replace your-domain.com with your actual domain
|
||||
{$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
|
||||
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
|
||||
}
|
||||
}
|
||||
|
||||
# Redirect www to non-www (optional)
|
||||
www.{$DOMAIN} {
|
||||
import snippets/Logging
|
||||
redir https://{$DOMAIN}{uri}
|
||||
}
|
||||
Reference in New Issue
Block a user