Serving Ghost in

We have a self-deployed Ghost 5.66 instance accessible at blog,ourdomain,com. For SEO reasons, we aim to serve the blog from ourdomain,com/blog.

To achieve this, we’ve deployed two Cloudflare workers that redirect all requests from blog,ourdomain,com to ourdomain,com/blog.

This setup works well for the blog’s content. However, when we try to access ourdomain,com/blog/ghost, we only see a blank page. If we navigate to ourdomain,com/blog/ghost/#signin, the login page appears. But upon attempting to log in, we encounter the following error message:

“Unable to determine the authenticated user or integration. Ensure that cookies are being passed through if using session authentication.”

We have attempted several solutions:

  • Disabling caching and speed improvements in Cloudflare.
  • Bypassing the redirect for blog,ourdomain,com/ghost in the Cloudflare workers, which was unsuccessful.
  • Setting the url parameter to ourdomain,com/blog.
  • Configuring admin__url to various values: ourdomain,com/blog, ourdomain,com/blog/ghost, and blog,ourdomain,com.

Have you reviewed some of the posts about how people have successfully hosted Ghost in subdirectory?

Here’s one that uses CloudFlare: