Oauth2 redirect_uri usa HTTP quando meu fórum está usando HTTPS

Olá,

Ativei o HTTPS para o meu fórum Discourse (Let’s Encrypt + nginx no sistema host). Nenhuma redireção foi adicionada, então os visitantes podem usar HTTP ou HTTPS. Tudo funcionou como esperado.

Em seguida, tentei ativar a autenticação Google Oauth2. No entanto, notei que o Discourse chamou o Google Oauth2 com redirect_uri definido como a URL HTTP do fórum, enquanto o fórum estava aberto com HTTPS.

Como posso corrigir isso? Meu fórum é https://discussion.listary.com/. Agradeço antecipadamente qualquer ajuda.

Do You have force https enabled?

1 curtida

No. Is there a Discourse setting for that?

Indeed there is!

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

2 curtidas

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 curtidas