It's possible to use an AWS CloudFront Distribution to setup a subdirectory with Ghost(Pro). For this configuration to work successfully, you must be on a Business plan with a subdirectory enabled and follow the configuration steps below.

Use of CloudFront for a subdirectory setup is considered highly advanced and may require additional technical knowledge and troubleshooting. The below configuration has been tested and works with these exact settings if there are no conflicting top-level config issues.

Distribution Settings

  • Alternate Domain Names must match the custom domain you want to use
  • The SSL Certificate must match the desired custom domain (either exact or wildcard).

Origins & Origin Groups Settings

  • Origin Domain Name must match the ghost.io URL
  • X-Forwarded-Host must be set to the desired custom domain
  • X-Forwarded-Proto must be set to https

Behaviour Settings

The default behaviour settings for your distribution can be used, however you will need to setup a second behaviour with the following settings:

  • The Path Pattern field needs to be set with the desired subdirectory, e.g. blog*
  • The Viewer Protocol Policy must be set to Redirect HTTP to HTTPS
  • The Origin, Referer and User-Agent headers must be whitelisted

Route 53 Settings / DNS

If you are using Route 53 with your domain to manage DNS records, an alias record must be set with a target of the CloudFront Distribution.

If you are using a non-Route 53 DNS provider, you will need to create an alias record that points to your CloudFront Distribution address.