Hey all,
I’m wondering how you all are self-hosting ghost with an SSR framework. I’m struggling a little bit but this is my first time really self-hosting and running the whole stack on my own.
I have the ghost headless CMS set up on a DigitalOcean droplet, and it’s configured via cloudflare DNS as edit.blogname.com
and this has been working great for CRUD.
For the frontend I’m using Astro to fetch and render content and it’s deployed via Cloudflare Pages and it’s also been smooth sailing.
The issue I’m having is that I’ve set up ghost to run and create content on edit.blogname.com
and the Astro frontend is set up for www.blogname.com
.
I noticed that all the content with this approach is going to have the post meta as edit.blogname.com
instead of the SEO friendly blogname.com
. I tried changing the ghost URL to blogname.com
but as you can imagine all the /content
routes weren’t working because they were fetching on the Cloudflare worker/Astro part, not edit.blogname.com/content/...
so it was just returning empty HTML pages instead of images and resources.
The current idea I have is just to run all URLs through a helper function that strips edit.blogname.com
from the domain for canonical URLs. This doesn’t feel terrible but is it possible to define a separate URL somewhere for ghost to use when generating metadata?
Just for reference, here’s my Cloudflare DNS setup.
TYPE | NAME | CONTENT | PROXY
A | edit | 123.456.78 | DNS ONLY
CNAME | www | blogname.pages.dev | PROXY ENABLED