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 192.168.178.68;
...
proxy_pass http://127.0.0.1:82;
....

And the "real" config:

server {
listen 127.0.0.1:82;
server_name 127.0.0.1;
...

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

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

https://doc.owncloud.org/server/latest/admin_manual/configuration_server/reverse_proxy_configuration.html#overwrite-parameters