Artichoke
Dabbler
- Joined
- Jul 12, 2021
- Messages
- 24
I have a TrueNAS SCALE instance installed with Nextcloud 23.0.2_1.3.13 installed through the Apps section in the TrueNAS SCALE UI. After I install Nextcloud, I am able to access the web UI through my local IP and it works well. However, When I try to access Nextcloud from my domain (let's call it mydomain.tld), it keeps trying to redirect me to my local IP. I have found other similar issues like this on these forums and Nextcloud's, but none of the solutions that worked for them worked for me.
Here is my setup:
Here is a list of things I have changed and/or tried:
Here is my setup:
- TrueNAS version: TrueNAS-SCALE-22.02.0
- Nextcloud version: Nextcloud 23.0.2_1.3.13
- DNS: Domain registered and protected with Cloudflare
- Port forwarding: Internal port 9001 -> External port 443
- Certificate: Let's Encrypt
- Nextcloud app config:
-
- Nextcloud config.php:
Code:
<?php
$CONFIG = array (
'htaccess.RewriteBase' => '/',
'memcache.local' => '\\OC\\Memcache\\APCu',
'apps_paths' =>
array (
0 =>
array (
'path' => '/var/www/html/apps',
'url' => '/apps',
'writable' => false,
),
1 =>
array (
'path' => '/var/www/html/custom_apps',
'url' => '/custom_apps',
'writable' => true,
),
),
'overwritehost' => 'mydomain.tld',
'overwriteprotocol' => 'https',
'trusted_proxies' =>
array (
0 => '10.42.0.0/16',
1 => '103.21.244.0/22',
2 => '103.22.200.0/22',
3 => '103.31.4.0/22',
4 => '104.16.0.0/12',
5 => '108.162.192.0/18',
6 => '131.0.72.0/22',
7 => '141.101.64.0/18',
8 => '162.158.0.0/15',
9 => '172.64.0.0/13',
10 => '173.245.48.0/20',
11 => '188.114.96.0/20',
12 => '190.93.240.0/20',
13 => '197.234.240.0/22',
14 => '198.41.128.0/17',
15 => '2400:cb00::/32',
16 => '2606:4700::/32',
17 => '2803:f800::/32',
18 => '2405:b500::/32',
19 => '2405:8100::/32',
20 => '2c0f:f248::/32',
21 => '127.0.0.1',
),
'forwarded_for_headers' =>
array (
0 => 'HTTP_CF_CONNECTING_IP',
),
'passwordsalt' => 'REDACTED',
'secret' => 'REDACTED',
'trusted_domains' =>
array (
0 => 'localhost',
1 => 'mydomain.tld',
),
'datadirectory' => '/var/www/html/data',
'dbtype' => 'pgsql',
'version' => '23.0.2.1',
'overwrite.cli.url' => 'https://mydomain.tld',
'dbname' => 'REDACTED',
'dbhost' => 'REDACTED',
'dbport' => '',
'dbtableprefix' => 'oc_',
'dbuser' => 'REDACTED',
'dbpassword' => 'REDACTED',
'installed' => true,
'instanceid' => 'occnx70veem7',
);Here is a list of things I have changed and/or tried:
- setting the overwrite_url and overwrite_cli_url in Nextcloud's config.php to mydomain.tld
- changing the host from my local IP to mydomain.tld (this results in the domain being right, but not the port)
- Adding Cloudflare's reverse proxies to the trusted_proxies in Nextcloud config.php
- Turning off Cloudlfare proxy and setting it to dns only
- Port forwarding and testing another webserver to confirm its TrueNAS or Nextclouds fault