Unable to access NextCloud on local lan

Nextcloud version (eg, 12.0.2): 14
Operating system and version (eg, Ubuntu 17.04): FreeBSD/FreeNAS
Apache or nginx version (eg, Apache 2.4.25): Apache24
PHP version (eg, 7.1): 7.1

The issue you are facing:
I am unable to access NextCloud on the local LAN using the script from https://github.com/danb35/freenas-iocage-nextcloud, if you review the script, nothing would indicate what the issue is.

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

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

<?php
$CONFIG = array (
  'passwordsalt' => 'mmmmsalt',
  'secret' => 'itsasecret',
  'trusted_domains' =>
  array (
    0 => 'localhost',
    1 => 'ddns host',
    2 => '192.168.1.56',
  ),
  'datadirectory' => '/mnt/files',
  'dbtype' => 'mysql',
  'version' => '14.0.3.0',
  'overwrite.cli.url' => 'https://ddns host/',
  'dbname' => 'nextcloud',
  'dbhost' => 'localhost:/tmp/mysql.sock',
  'dbport' => '',
  'dbtableprefix' => 'oc_',
  'dbuser' => 'nextcloud',
  'dbpassword' => 'password',
  'installed' => true,
  'instanceid' => 'oc5d3qihvo1z',
  'logtimezone' => 'America/Los_Angeles',
  'log_type' => 'file',
  'logfile' => '/var/log/nextcloud.log',
  'loglevel' => '2',
  'logrotate_size' => '104847600',
  'memcache.local' => '\\OC\\Memcache\\APCu',
  'redis' =>
  array (
    'host' => '/tmp/redis.sock',
    'port' => 0,
  ),
  'memcache.locking' => '\\OC\\Memcache\\Redis',
  'htaccess.RewriteBase' => '/',
);

Someone on IRC suggested using a socks5 proxy to access it on the local lan which does work but breaks all my clients.

I am maybe suspecting this: System config value overwrite.cli.url set to string https://ddns host/?

No one has any idea’s?

Not sure why I got 0 responses to my question but I finally resolved the issue by adding the ddns host to my dns server on my router. I never needed to do this with other apps before so I didn’t think to do anything in there.

1 Like

Could be an issue if you have no port opened in your router:

  1. you connect e.g. 192.168.1.56
  2. NC will redirect you to ddns nost
  3. ddns host is bounded to your externals ip, e.g. 100.100.100.100
  4. your browser will try to access https://ddns host/ on 100.100.100.100
  5. If 443 port closed - you failed to connect.

That is correct, now you will be redirected to https://ddns host/ on 192.168.1.56 instead 100.100.100.100. You can also use your hosts file locally without any modifications on router for such kind of things.

“Not sure why I got 0 responses to my question but I finally resolved the issue by adding the ddns host to my dns server on my router. I never needed to do this with other apps before so I didn’t think to do anything in there.”

Thanks for this comment. It solves my problem. I also never add this option before, just ip’s and ports.