Headless CMS Setup: How to change Preview URL to Admin URL?

Hi there,

I’ve been working on a custom Headless CMS + NextJS setup, where both Frontend and Backend are hosted on different hosts.

Currently, I’m running on a bare-essentials setup since sadly Memberships is not ready for Headless CMS right now.

However, there is one issue I am facing right now, is that though most of the Ghost setup is running quite alright at the moment, the only issues I am unsure how to resolve, is when I am writing my new posts with my Ghost backend, and previewing the posts, instead of posting a simple “Preview” via https://backend.ghostwebsite.com/api/preview, the Preview instead shows up on https://ghostwebsite.com/api/preview.

Though I do understand why it is happening, as I have previously changed the url variable in config.production.json, I was wondering is there a way I may alter this Preview URL to reflect the Backend URL instead, as for my Frontend, anything that is posted that is not pre-build and uploaded to the sever will be thrown as a 404 Error Page.

Hope someone can assist on this matter.

Thank you so much in advance! ;)

Ghost v4.19.1

1 Like