Can't access Nextcloud locally (LAN)

Nextcloud version : 23
Operating system and version : TrueNas Core 12
Apache or nginx version :
PHP version : 8.0

The issue you are facing : I can connect to my Nextcloud outside of my LAN, but not on my LAN. Domain or IP is not working.

Is this the first time you’ve seen this error? : Yes

Output of config.php :

$CONFIG = array (
  'passwordsalt' => 'xxx',
  'trusted_domains' =>
  array (
    0 => 'localhost',
    1 => 'xxx',
    2 => '',
  'datadirectory' => '/mnt/files',
  'dbtype' => 'mysql',
  'version' => '',
  'overwrite.cli.url' => 'xxx',
  'dbname' => 'nextcloud',
  'dbhost' => 'localhost:/tmp/mysql.sock',
  'dbport' => '',
  'dbtableprefix' => 'oc_',
  'mysql.utf8mb4' => true,
  'dbuser' => 'nextcloud',
  'dbpassword' => 'xxx',
  'installed' => true,
  'instanceid' => 'occxh1vmztyf',
  'logtimezone' => 'Europe/Paris',
  'default_phone_region' => 'FR',
  'log_type' => 'file',
  'logfile' => '/var/log/nextcloud/nextcloud.log',
  'loglevel' => '2',
  'logrotate_size' => '104847600',
  'memcache.local' => '\\OC\\Memcache\\APCu',
  'redis' =>
  array (
    'host' => '/var/run/redis/redis.sock',
    'port' => 0,
  'memcache.distributed' => '\\OC\\Memcache\\Redis',
  'memcache.locking' => '\\OC\\Memcache\\Redis',
  'overwritehost' => '',
  'overwriteprotocol' => 'https',
  'htaccess.RewriteBase' => '/',

Hello everyone, I ran into different topics with a similar problem to mine, but I can’t seem to solve it.

My situation :

I followed this tutorial to install Nextcloud on my NAS: GitHub - danb35/freenas-iocage-nextcloud: Script to create an iocage jail on FreeNAS for the latest Nextcloud 23 release, including Caddy, MariaDB or PostgreSQL, and Let's Encrypt.

The installation obtains an SSL certificate with Let’s Encrypt to secure the connection.
Managed to configure it correctly with my OVH domain name.
Access from the outside works.

However, I cannot connect to it from my home network with the domain name or the static IP address of the server (a jail on TrueNas).

  • How to define the origin of the problem? I have read on various forums that it could be a router problem. With my Livebox Play, it is impossible to avoid loopback / hairpinning or to configure a DynHost with OVH, the option is not offered …

  • Do you know of any solutions to get around it: change the configuration, change the router, use a VPN, etc. ?

I dig all over the place but I can’t find anything satisfactory :face_with_monocle:

PS: I am new to network settings, I have learned most of the terms used above in recent days only by reading tutorials and forums

Did you ever find a solution? I’m facing a similar issue in that I can’t access it using the IP address within the LAN. I can however access it using the domain name.