OAuth2 redirect_uri يستخدم HTTP بينما يستخدم المنتدى HTTPS

مرحباً،

لقد قمت للتو بتفعيل HTTPS في منتدى Discourse الخاص بي (باستخدام Let’s Encrypt و nginx على نظام المضيف). لم تتم إضافة إعادة توجيه، لذا يمكن للزوار استخدام HTTP أو HTTPS. كل شيء عمل كما هو متوقع.

ثم حاولت تمكين مصادقة Google OAuth2. ومع ذلك، لاحظت أن Discourse اتصل بـ Google OAuth2 مع تعيين redirect_uri إلى عنوان URL للمنتدى عبر HTTP بينما كان المنتدى مفتوحًا عبر HTTPS.

كيف يمكنني إصلاح ذلك؟ منتدىي هو 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 إعجابات