Aras behind Nginx reverse proxy and https


I'm setting up Aras behind an Nginx reverse proxy which works fine when using http.

Now I've set up Nginx to add SSL and redirect everything to https and adjusted the
URLs in InnovatorServerConfig.xml and OAuth.config to use https as well.

The problem as far a I can tell ist that when Nginx passes the https request as an http request to the OAuthServer which then returns the .../.well-known/openid-configuration with http URLs instead of https ones.. (the rest of the URLs are fine).

How can I get OAuthServer to return the correct links?
I've tried setting the X-Forwarded-Proto header to https but OAuth seems to ignore that.

Thank you for your help