Redirect to https - error, reload to try again

I have a Debian server instaled with Docker and NGINX as reverse proxy.
If I go the i get the UI fine. No problem.
But if I try to reach the UI with, which should redirect to https, it shows an error banner and a “Reload to try again or log out”. If i reload the page it redirects fine.

In Chrome dev tools i can see this error in the Console.

XMLHttpRequest cannot load No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin '' is therefore not allowed access.

Why is this happening?

My NGINX conf file is as in the Docs.

It works now… No clue why ?!