Il tag proxy X-Forwarded-For non è riconosciuto da Discourse?

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