Custom CMS previews work locally but not online

For anyone looking for a possible solution: