Eh bien, après tant de tentatives infructueuses, j’ai enfin trouvé comment avoir une connexion valide avec force_https=true.
Dans l’environnement Docker, j’ai patché /etc/nginx/conf.d/discourse.conf comme suit :
…
location @discourse {
limit_conn connperip 20;
limit_req zone=flood burst=12 nodelay;
limit_req zone=bot burst=100 nodelay;
proxy_set_header Host $http_host;
proxy_set_header X-Request-Start “t=${msec}”;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto https; # $thescheme; ← Ce que j’ai modifié
proxy_pass http://discourse;
}
…
Et cela ne fonctionne que dans cette section, du moins avec mon environnement.
Ça marche super bien maintenant !