I just enabled HTTPS for my Discourse forum (Let’s Encrypt + nginx on host system). No redirection was added so visitors can use HTTP or HTTPS. Everything worked as expected.
Then I tried to enable Google Oauth2 authentication. However, I noticed that Discourse called Google Oauth2 with redirect_uri set to the HTTP forum URL while the forum was opened with HTTPS.
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.