SOLVED How to make NextCloud keep my port number in the URL?

dearmusic

Cadet
Joined
Nov 29, 2021
Messages
2
Hello,

I have been tackling this problem with both TrueNas Core and TrueNas Scale for weeks already, and I can't find out what I did wrong...

My ISP recently decided to block port 80 and port 443, so I decided to use port 9999 for my NextCloud
What I did is that I made https://<domain>:9999 go through my router's port forwarding to the Nginx Reverse Proxy
And then from the Nginx Reverse Proxy to my NextCloud jail.

Normally when accessing NextCloud, it will redirect to the login page, for example https://<domain> goes to https://<domain>/login
What happened in my case is that https://<domain>:9999 get redirected to https://<domain>/login, dropping the port number which results in being unable to access the page.

Does anyone know how to make Nextloud not drop my port number?
I switched back to Core now, but Scale and Core solutions are all welcome!
 

dearmusic

Cadet
Joined
Nov 29, 2021
Messages
2
Ahh... I can't believe I wasted so much time on something so simple... I found the solution now and I want to delete this post out of shame...

The answer is 'overwritehost' => '<domain:9999>', in NextCloud... It's not even a TrueNas problem...
 
Top