Been trying to solve this with a Digital Ocean technician for a couple days, but the situation seems too specific for his competence and I assume I’m not the only person who ran into this problem.
A place where the bug occurs: http://beckyverse.com/writing/cergy-1314/returning-fr
I’m trying to embed Discourse threads on some pages of my main site warranting discussion, which is Kirby CMS-based. Here’s a discussion I had attempting to solve the problem on the Kirby support forum. Trouble is, I’m getting a 403 when the main site attempts to load the comments thread. I’ve already browsed through most of the obviously available resources, and haven’t been able to solve the problem on my own, so I assume either the problem is just badly documented or my lack of competence with Docker is preventing me from advancing any further.
What I’m roughly sure about:
The issue is CORS-related. The main site is actually able to load part of the Discourse instance (the blue links at the bottom of the article are the custom header of my Discourse instance), but it can’t load the threads proper.
Based on the error messages I’m getting, I assume the problem occurs at the nginx layer. enable-cors.org describes a method to get nginx to comply with CORS requests, but Discourse running in a Docker container means I can’t just edit the configuration file of nginx within the container and expect the fix to last. Admittedly, I haven’t tried (I’d like to go straight for the “hopefully lasting fix”) because I don’t know how exactly the configuration file is structured. In other words, I’m looking for an action I’d be able to apply to app.yml in order to properly configure nginx (assuming it’s actually the problem) in the rebuilt container.
What I’ve looked at:
I’ve tried comparing my network logs with this page’s on eviltrout’s blog. It looks roughly the same, except for the 403 error occurring on my side.
I’ve included the CORS fix plugin’s installation in my app.yml file.
I’ve tried the generic “Access-Control-Allow-Origin: *” implementation in the app.yml file, and removed it because it didn’t seem to change anything.
Sooo yeah, basically I’m stuck. Any leads?
EDIT: Here’s a log from the Discourse instance logs:
HTTP_HOST: talk.beckyverse.com REQUEST_URI: /logs/report_js_error REQUEST_METHOD: POST HTTP_USER_AGENT: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.9; rv:28.0) Gecko/20100101 Firefox/28.0 HTTP_ACCEPT: */* HTTP_REFERER: http://talk.beckyverse.com/embed/comments?embed_url=http%3A%2F%2Fbeckyverse.com%2Fwriting%2Fcergy-1314%2Freturning-fr HTTP_X_FORWARDED_FOR: 220.127.116.11 HTTP_X_REAL_IP: 18.104.22.168 params: message: TypeError: PreloadStore.get(...) is undefined Url: http://talk.beckyverse.com/embed/comments?embed_ur url: http://talk.beckyverse.com/embed/comments?embed_url=http%3A%2F%2Fbeckyverse.com%2Fwriting%2Fcergy-131 line: 241 window_location: http://talk.beckyverse.com/embed/comments?embed_url=http%3A%2F%2Fbeckyverse.com%2Fwriting%2Fcergy-131