Files
ghost-docker/caddy/Caddyfile.example
James Loh c6211c9493 Caddy: Add note about redirect requirement for ActivityPub
no ref

- Our ActivityPub framework lets users set their AP username to index@example.com and have Ghost on www.example.com (ie instead of having their AP user be index@www.example.com)
- To do this users _must_ redirect from the non-www domain -> the www domain as the AP protocol will do lookups on the non-www path to validate and communicate to that username on the web
- Without this AP will fail since domains can't communicate with AP as there wont be redirects for them to follow
2025-07-15 21:22:33 +10:00

59 lines
1.5 KiB
Caddyfile

# 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
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} {
# import snippets/Logging
# redir https://{$DOMAIN}{uri}
# }
# If you want to redirect the non-www variant of your domain to the www varient uncomment the below 4 lines and replace REPLACE_ME with your domain
# Note: You must have DNS setup correctly for this to work
# If you're want to enable ActivityPub you _must_ enable this redirect
# REPLACE_ME {
# import snippets/Logging
# redir https://REPLACE_ME{uri}
# }