{$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 } # Separate admin domains # To use a separate domain for Ghost Admin uncomment the block below (recommended) # {$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 # } # Redirect www -> root domain # To redirect the www variant of your domain to the non-www variant uncomment the 4 lines below # Note: You must have DNS setup correctly for both domains for this to work # www.{$DOMAIN} { # import snippets/Logging # redir https://{$DOMAIN}{uri} # } # Redirect root -> www domain # To redirect the non-www variant of your domain to the www variant uncomment the 4 lines below and change CHANGE_ME to your root domain # Note: You must have DNS setup correctly for both domains for this to work # If you want to use ActivityPub you _must_ enable this redirect # CHANGE_ME { # import snippets/Logging # redir https://{$DOMAIN}{uri} # }