Oauth2 redirect_uri usa HTTP quando il mio forum utilizza HTTPS

Ciao,

Ho appena abilitato HTTPS per il mio forum Discourse (Let’s Encrypt + nginx sul sistema host). Non è stata aggiunta alcuna reindirizzamento, quindi i visitatori possono utilizzare HTTP o HTTPS. Tutto ha funzionato come previsto.

Poi ho provato ad abilitare l’autenticazione Google OAuth2. Tuttavia, ho notato che Discourse ha chiamato Google OAuth2 con redirect_uri impostato sull’URL HTTP del forum, mentre il forum era aperto con HTTPS.

Come posso risolvere? Il mio forum è https://discussion.listary.com/. Grazie in anticipo per qualsiasi aiuto.

Do You have force https enabled?

1 Mi Piace

No. Is there a Discourse setting for that?

Indeed there is!

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

2 Mi Piace

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 Mi Piace