XWiki adds port 80 to URL

I am trying to run XWiki on https:mydomain/xwiki in tomcat running on (local) port 8080 behind nginx, and on the first call of that site I get the following error:

Failed to extract Entity Resource Reference from URL [https://mydomain:80/xwiki/bin/view/Main/]

Of course, https://mydomain:80 is not available.

My nginx configuration (part):

        location ~ ^/(xwiki|some_other_tomcat_apps)(/|$) {
            proxy_set_header        Host $host;
            proxy_set_header        X-Real-IP $remote_addr;
            proxy_set_header        X-Forwarded-For $proxy_add_x_forwarded_for;
            proxy_set_header        X-Forwarded-Proto $scheme;

            proxy_pass              http://localhost:8080;

            proxy_read_timeout  90;

            proxy_redirect      http://localhost:8080 https://mydomain;
            expires 0m;
        }

Why don’t your redirect the traffic from 80 to 8080?