Problem accessing external DNS in Nextcloud App

Nextcloud version (eg, 20.0.5): Nextcloud Hub 6 (27.1.4)
Operating system and version (eg, Ubuntu 20.04): Ubuntu 22.04.3 LTS (Server)

The issue you are facing:

I have an external DNS through no-ip pointing to my local network. Ports 80 and 443 are open and I can access my nextcloud instance by using it. However, when inside my local network, I can access it when on my phone browser (safari) but when using the app the connection times out.

I thought it was because my router can’t map traffic internally to external addresses that point back to itself, but since I can access it through the browser I’m not sure what the problem is.

Any help is appreciated!

Is this the first time you’ve seen this error? (Y/N): Y

Steps to replicate it:

  1. Install nextcloud via snap
  2. Go through normal setup
  3. Setup external DNS and open ports 80 and 443
  4. Use lets-encrypt to create certificates for DNS domain

The output of your config.php file in /path/to/nextcloud (make sure you remove any identifiable information!):

<?php
$CONFIG = array (
  'apps_paths' => 
  array (
    0 => 
    array (
      'path' => '/snap/nextcloud/current/htdocs/apps',
      'url' => '/apps',
      'writable' => false,
    ),
    1 => 
    array (
      'path' => '/var/snap/nextcloud/current/nextcloud/extra-apps',
      'url' => '/extra-apps',
      'writable' => true,
    ),
  ),
  'supportedDatabases' => 
  array (
    0 => 'mysql',
  ),
  'memcache.locking' => '\\OC\\Memcache\\Redis',
  'memcache.local' => '\\OC\\Memcache\\Redis',
  'redis' => 
  array (
    'host' => '/tmp/sockets/redis.sock',
    'port' => 0,
  ),
  'log_type' => 'file',
  'logfile' => '/var/snap/nextcloud/current/logs/nextcloud.log',
  'logfilemode' => 416,
  'passwordsalt' => '[redacted]',
  'trusted_domains' => 
  array (
    0 => 'localhost',
    1 => '[Address setup with no-ip]' 
    2 => ''[internal IP]',
  ),
  'datadirectory' => '/var/snap/nextcloud/common/nextcloud/data',
  'dbtype' => 'mysql',
  'version' => '27.1.4.1',
  'overwrite.cli.url' => 'http://localhost',
  'dbname' => 'nextcloud',
  'dbhost' => 'localhost:/tmp/sockets/mysql.sock',
  'dbport' => '',
  'dbtableprefix' => 'oc_',
  'mysql.utf8mb4' => true,
  'dbuser' => 'nextcloud',
  'dbpassword' => '[redacted]',
  'installed' => true,
  'instanceid' => ''[redacted]',
  'maintenance' => false,
);

Do you really have 2 entries in that array with the same following number?
shouldn’t it be
0
1
2

instead of
0
2
2

Oh no, sorry. It was just an edit error when I was removing the actual values. Fixed!