I’m facing an issue while connecting Discourse to WordPress using the Discourse Plugin. I’m running Discourse on a Digital Ocean droplet. The setup was performed exactly as mentioned here (discourse/docs/INSTALL-cloud.md at main · discourse/discourse · GitHub). The droplet itself sits behind CloudFlare and HTTPS was setup using Let’s Encrypt (using Set up HTTPS support with Let's Encrypt). The WordPress site is deployed on SiteGround, also behind CloudFlare.
When I add the forum’s root address, API key and administrator username in the plugin settings, in WordPress’ console, it still keeps saying “You’re not connected to Discourse”. Upon further investigating I’ve found that this particular request /site.json%20?api_key=[FILTERED]&api_username=<username> is returning 403 Forbidden even with a fresh, valid API Key and a valid administrator username.
The request to site.json is checking that an API request can be made with the values supplied for the API Key and Publishing Username that are set on WordPress. If you make the request with curl from your local computer, is it working for you? For example, this request with $api_key set to your API key:
curl -X GET 'https://forum.example.com/site.json?api_key=$api_key&api_username=system'
If this is woking for you, you could try installing the WordPress Health Check plugin and looking at the Secure communication row on the Site Status tab to see if it’s finding any issues with communicating with external services using secure connections (SSL.)
Meine WordPress-Website fususu.com ist mit SSL-Flexible (Cloudflare) eingerichtet,
zusammen mit einer Page Rule für das Forum forum.fususu.com – Full SSL (Cloudflare).
Ist es Ihnen jemals gelungen, das zum Laufen zu bringen? Ich habe die gleiche Einrichtung (Discourse auf Digital Ocean, WordPress auf Siteground, beide hinter Cloudflare) und denselben Fehler. Curl funktioniert von meinem lokalen Rechner problemlos.
Wenn ich per SSH auf den gemeinsam genutzten Server (der von SiteGround gehostet wird) verbinde und manuell einen curl-Befehl ausführe, um meine Discourse-Installation abzurufen, erhalte ich dieselbe Fehlermeldung;
Ich habe sogar eine neue WordPress-Seite erstellt, mit einer neuen Domain (obwohl auf demselben SiteGround-Server), ohne dass Cloudflare das DNS betreibt, und erhielt dieselbe Fehlermeldung.
Gelöst. Das war einer dieser nervigen Fälle, bei denen es einfach „plötzlich funktioniert hat“, ohne dass eine klare Lösung bekannt wurde. Ich gehe davon aus, dass es sich um ein Problem mit der DNS-Propagierung handelte und dass der DNS-Resolver von Siteground aus irgendeinem Grund langsam war.
Wenn jemand anderes auf dieses Problem stößt, lautet mein einziger Rat: Warten Sie 48 Stunden und versuchen Sie es erneut. :-/