X-Forwarded-For Proxy-Tag von Discourse nicht erkannt?

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