OAuth2 の redirect_uri が、フォーラムが HTTPS を使用しているのに HTTP を使用している

こんにちは、

Discourse フォーラム(ホストシステム上の Let’s Encrypt + nginx)で HTTPS を有効にしました。リダイレクトは追加していないため、訪問者は HTTP または HTTPS のどちらでもアクセスできます。すべて期待通りに動作しました。

その後、Google OAuth2 認証を有効にしようと試みました。しかし、フォーラムが HTTPS で開かれているにもかかわらず、Discourse が Google OAuth2 を呼び出す際に redirect_uri に HTTP のフォーラム URL が設定されていることに気づきました。

これをどうすれば修正できますか?私のフォーラムは https://discussion.listary.com/ です。ご助力をいただき、ありがとうございます。

Do You have force https enabled?

「いいね!」 1

No. Is there a Discourse setting for that?

Indeed there is!

In admin > settings
Search for force https and enable it.

「いいね!」 2

Just tried that setting. And unfortunately, it’s still the same.

I think Discourse should be able to detect the original protocol automatically. I don’t know why it doesn’t work in my case.

I got it working. I used Certbot to manage Let’s Encrypt on my host system. It turned out that some rules Certbot added to the nginx config file is not fully compaitible with Discourse docker. I fixed it according to Running other websites on the same machine as Discourse.

「いいね!」 3