Headless CraftCMS: How can I tell Craft to load live preview from a different (sub)domain?
Since Craft 3.3.1, you can create a custom alias that resolves to your frontend base URL, and add that alias to the relevant preview targets' "URL Format" setting.

For example, assuming you put something like the below in your config/general.php file:

'aliases' =&gt; [
    '@previewBaseUrl' =&gt; 'https://domain.com',
],


...you'd be able to use that @previewBaseUrl alias in your preview targets, e.g. @previewBaseUrl/posts/{slug}