How to setup ghost to use relative URLs or not changing the URL used to access it

I’m trying to setup ghost so I can access it with an internal URL, and a public (through CDN) URL.
Everything ghost sends (including e-mails) link to the CDN URL but when a request is done through the internal URL must not be changed.
For SEO purposes, only the CDN (imagine cloudflare) URL matters.
The other URL is for more deep needs.

The internal URL is used for a multitude of purposes that the CDN doesn’t allow. Includes debugging (E.g. confirming that page navigation is working well and performant), analysis, sending proxy-blocked HTTP requests and accessing the admin panel.
From the manual, the admin panel can have a different domain. However, I don’t see any way to set so ghost doesn’t try to modify the URL used to access it or provide links without absolute URLs.

Do note that the connections from the CDN are with HTTPS and internal connections are done with HTTP.
For me, this is very easy to setup with nginx and apache2 (web server) but I can’t figure out how to set this up with ghost (because it keeps using absolute URLs throughout its UI).

In reality, if all URLs in ghost (except if admin url is set) were relative, I wouldn’t have this issue. But it exists.
How to solve it?