I have searched the forum for an answer to this issue and tried a few of the different posted options.
I am running a Ghost publication on a Digital Ocean Droplet, and a Discourse forum on a separate Digital Ocean Droplet, as the forum consensus seemed to be that you should not install two applications on the same server.
forum.mysite dot com
mysite dot com
I would like the discourse comments to appear on every post, and I do not have a mysite.com/blog URL slug. So I followed the documentation to get the current site URL and use that as the embed URL.
Following the documentation here: Official Integration Documentation
I am able to get the frame to appear on any new posts. However, it does not load and provides the following error:
Failed to execute 'postMessage' on 'DOMWindow': The target origin provided ('<URL>') does not match the recipient window's origin ('<URL>').
I have confirmed that my HTTPS settings are correct. My embedded URL mimicks the tutorial, but I tried a few different variations of discourseEmbedUrl: in an attempt to troubleshoot. All of the references to the current article URL are causing the same error.
I also tried adding a wait function, thinking perhaps the frame did not load, but the same error persists.
This is my current embedded code:
<div id='discourse-comments'></div>
<meta name='discourse-username' content='JosephPaul'>
<script type="text/javascript">
DiscourseEmbed = {
discourseUrl: 'https://forum.mysite.com/',
discourseEmbedUrl: '{{url absolute="true"}}',
// className: 'CLASS_NAME',
};
(function() {
var d = document.createElement('script'); d.type = 'text/javascript'; d.async = true;
d.src = DiscourseEmbed.discourseUrl + 'javascripts/embed.js';
(document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(d);
})();
</script>
Any assistance here would be appreciated, as I have exhausted all solutions posted. I believe it may have to do with my forum and articles being on separate machines.