Le tag proxy X-Forwarded-For n'est-il pas reconnu par Discourse ?

Why would you do the redirect there? Do it at the outer layer, where you’re terminating HTTPS.