Access through untrusted domain on local lan

Hey

New to Nextcloud here and trying to get it up and running on my Truenas.
Running Truenas 24.10 electric eel and running Nextcloud 30.0.1.

Did a simple install and have issues getting it to work both locally and remotely.

I get the error Access through an untrusted domain when I connect locally. But when I added my Cloudflare to the trusted domain list I had no issues connecting to it. This is if I choose Certificate ID - ‘truenas_default’ Certificate during the installation.

If I don’t do that then it works with no errors locally but it does not work remotely with either Cloudflare or Tailscale. I don’t get an error, only a blank screen. Testing with Tailscale and Cloudflare I can point it to anything else on the NAS and it works just fine.

Have added all of the domains and IPs I can think of and so far I can either get it to work remotely or locally but not both.

Also tested a direct connection to the server to eliminate any network issues and the same problem.

Know Electric Eel has not been out for long so hoping it’s a bit of an early adaptor bug.

Also the Trunas install is fresh and just trying to figure stuff out before I pull the trigger on a full system build.

If anyone has any ideas I would love to hear them, Chat GDP was to little to no help :stuck_out_tongue:

1 Like

What do you mean by “my Cloudflare”?

Basically trusted_domains has to contain the URL you use to access your instance. So if that is “https://cloud.domain.tld” then you need to have cloud.domain.tld in your trusted_domains list.

it does not work remotely with either Cloudflare or Tailscale. I don’t get an error, only a blank screen. Testing with Tailscale and Cloudflare I can point it to anything else on the NAS and it works just fine.

What, precisely, are you pointing your Cloudflare proxy configuration at? What does your browser inspector show in the Console and Network tabs when you load the page remotely?

Have added all of the domains and IPs I can think of and so far I can either get it to work remotely or locally but not both.

Please post your Nextcloud config (occ config:list system).

Thanks for the repy.

Yes I added my Cloudflare domain to my domain list and it worked just fine when remotely accessing that domain. But still get that error on my Lan when connecting locally.

So with this config file, I can use Cloudflare to access remotely:

  GNU nano 7.2                                                                                                                                                                                                                                                             config.php                                                                                                                                                                                                                                                                       
<?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,
    ),
  ),
  'memcache.distributed' => '\\OC\\Memcache\\Redis',
  'memcache.locking' => '\\OC\\Memcache\\Redis',
  'redis' => 
  array (
    'host' => 'redis',
    'password' => 'xxxxxxx',
    'port' => 6379,
  ),
  'upgrade.disable-web' => true,
  'passwordsalt' => 'Bji86Yluz8yE+Zx8VA4Y/RLe74JNGV',
  'secret' => 'T4Sus3bM6ldjXqZOShPn8V7tdI4FxeIOzmR5cThhx+IRB4r7',
  'trusted_domains' => 
  array (
    0 => 'localhost',
    1 => '127.0.0.1',
    2 => 'localhost',
    3 => 'nextcloud',
    4 => 'my.domian.org',
  ),
  'datadirectory' => '/var/www/html/data',
  'dbtype' => 'pgsql',
  'version' => '30.0.1.2',
  'overwrite.cli.url' => 'http://localhost',
  'dbname' => 'nextcloud',
  'dbhost' => 'postgres:5432',
  'dbport' => '',
  'dbtableprefix' => 'oc_',
  'dbuser' => 'oc_admin',
  'dbpassword' => 'xxxxxxxx',
  'installed' => true,
  'instanceid' => 'ochi9870u9u5',
);

This is a new install I just did and added the “my.domin.org
The installation is then without the “Certificate ID - ‘truenas_default’ Certificate”
In Cloudflare, I’m pointing to the “TrunelasIP:30027”

tried to add the nas ip, my computer ip, and still can’t connect locally. Just he same error.

And if I do another fresh install and and add the “my.domain.org” as before I will not even load if i try to access it with that domain. Also tried to add the “my.domain.org” to the proxie list but that does not do anything. Under is that fresh install config file:

  GNU nano 7.2                                                                                                                                                                                                                                                             config.php                                                                                                                                                                                                                                                                       
<?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,
    ),
  ),
  'memcache.distributed' => '\\OC\\Memcache\\Redis',
  'memcache.locking' => '\\OC\\Memcache\\Redis',
  'redis' => 
  array (
    'host' => 'redis',
    'password' => 'xxxxxxx',
    'port' => 6379,
  ),
  'overwriteprotocol' => 'https',
  'trusted_proxies' => 
  array (
    0 => '127.0.0.1',
    1 => '192.168.0.0/16',
    2 => '172.16.0.0/12',
    3 => '10.0.0.0/8',
  ),
  'upgrade.disable-web' => true,
  'passwordsalt' => 'lxxxxxxxxx',
  'secret' => 'wsGyEkQlHg3OWtoVwih251ao9ZdvWYS5UfOIH4R7vvFN7gKY',
  'trusted_domains' => 
  array (
    0 => 'localhost',
    1 => '127.0.0.1',
    2 => 'localhost',
    3 => 'nextcloud',
    4 => 'test.mlandpicturs.org',
  ),
  'datadirectory' => '/var/www/html/data',
  'dbtype' => 'pgsql',
  'version' => '30.0.1.2',
  'overwrite.cli.url' => 'https://localhost',
  'dbname' => 'nextcloud',
  'dbhost' => 'postgres:5432',
  'dbport' => '',
  'dbtableprefix' => 'oc_',
  'dbuser' => 'oc_admin',
  'dbpassword' => 'WzuQSqJZ6eLe7RCCKJelKTFGQdcJ9q',
  'installed' => true,
  'instanceid' => 'ocmyh5mantim',
);