Help with Nextcloud on TrueNAS - Reverse Proxy diverting to local IP Address

I have setup a new Nextcloud instance on my TrueNAS Scale system. All is working fine, but I am having reverse proxy issues. I have made the changes I always make in config.php, but whenever I browse to the FQDN I get diverted to the local IP/Port Address of the Server.

I have googled and tweaked the config but still cannot uderstand why I am not using the FQDN through the reverse proxy.

Wonder if someone can steer me in the right direction :slight_smile:

Here is the portion of the config.pho I have changed.


‘overwritehost’ => ‘nc.dotmac.co.uk’,
‘overwriteprotocol’ => ‘https’,
‘trusted_proxies’ =>
array (
0 => ‘127.0.0.1’,
1 => ‘::1’,
2 => ‘10.255.1.8’,
),
‘overwrite.cli.url’ => ‘https://nc.dotmac.co.uk’,
‘upgrade.disable-web’ => true,
‘passwordsalt’ => ‘REMOVED’,
‘secret’ => ‘REMOVED’,
‘trusted_domains’ =>
array (
0 => ‘nc.dotmac.co.uk’,
1 => ‘10.255.1.8’,
),

Any help or advice would be gratefully recieved :smiley:

thanks in advance

Gary

BUMP,

Anyone please?

This might turn your bump into a dull thud but I managed to crack this just by using ‘overwrite CLI host’.

I have Nextcloud installed on TrueNAS Scale as a TrueNAS App and nginx-proxy-manager installed via Truecharts. I’m also using tailscale, although I don’t think that part actually comes into play here. My domain name provider issues a free wildcard SSL so I have that in place both in Scale and Nginx-Proxy-Manager. No cert-bot, cloudfare or other guff; that’s way over my head.

Firstly, I have NO settings changed in config.php. I don’t even know how to find it. I added an Environment Variable through the basic TrueNAS Apps menu.

Yes, OK, I also have the ‘Overwrite Host’ variable in there too but it did chuff all when I added it first. I’m not taking it out though: if it ain’t broke…

One post on the TrueNAS forum insisted that the domain had to be in full, including “https://”. Nope. I ended up with the URL resolving to “https://https//nextcloud.this-is-my-domain.co.uk:9001”. Boooo.

Nginx-Proxy-Manager is running on Truecharts purely because I want it to run on ports 80 and 443, which isn’t possible for any iX Apps, at least according to legend, and certainly not for NPM. I had to install MetalLB, and MetalLB-config, through Truecharts to give me a fresh IP to access NPM. Thus:

  • DNS record for nextcloud.[domain].co.uk points to the local IP of NPM, 192.168.19.201
  • NPM has a proxy rule to pass nextcloud.[domain].co.uk to the local IP of Nextcloud, https://192.168.19.19:9001, with the SSL cert from the domain provider
  • Nextcloud is accessible inside and outside my home LAN via nextcloud.[domain].co.uk

Nextcloud is unreachable via any of the Tailscale ‘friendly’ names or the TS IPs: it’s only the local ones that work. I am not mentally prepared for Traefik yet, maybe in a few years, and I don’t fancy digging any other holes to fall into so I will leave it as it is. Providing my TrueNAS Scale box is advertising subnet routes, and I’m using a device linked to my Tailscale subnet, I can access my Nextcloud from anywhere.

Good luck.