SSO Loop - Help needed to find the problem

After enabling SSL directly in the Discourse-instance everything is working well again. Thanks for pointing that out.