Owncloud keep using custom port

Hi, I am running the current version of owncloud on a linux client on nginx. I can't use port 80/433 so I configured nginx to use 7002 instead. It works (mostly), I can open the url https:// cloud.myserver.de:7002/owncloud. Whenever I click on a link inside the owncloud interface afterwards I get redirected to https:// cloud.myserver.de/owncloud/target-of-the-link though (without the port).
( the spaces in the urls are only added because I can't post more "links")

I am using one nginx config as a proxy:

server {
listen 7002 ssl http2;
server_name cloud.myserver.de;

And the "real" config:

server {

How can I fix that? Do I need to set the base url (+Port) somewhere else?

Have a look at the config.php options listed here which might help: