Exposing Nextcloud to the web results in a local ip redirection


Exposing Nextcloud to the web results in a local ip redirection.

Resolving my.domain.com:12345 from outside results in
I redirected outside port 12345 to in the router.

I’m running NC in a jail.
What did I miss?

Thanks in advance!

$CONFIG = array (
  'apps_paths' => 
  array (
    0 => 
    array (
      'path' => '/usr/local/www/nextcloud/apps',
      'url' => '/apps',
      'writable' => true,
    1 => 
    array (
      'path' => '/usr/local/www/nextcloud/apps-pkg',
      'url' => '/apps-pkg',
      'writable' => false,
  'logfile' => '/var/log/nextcloud/nextcloud.log',
  'memcache.local' => '\\OC\\Memcache\\APCu',
  'one-click-instance' => true,
  'one-click-instance.user-limit' => 100,
  'memcache.distributed' => '\\OC\\Memcache\\Redis',
  'memcache.locking' => '\\OC\\Memcache\\Redis',
  'redis' => 
  array (
    'host' => 'localhost',
  'passwordsalt' => 'xxx',
  'secret' => 'xxx/',  'trusted_domains' => 
  array (
    0 => 'localhost',
    1 => '',
    2 => 'cloud.lan',
    3 => 'my.domain.com',
  'datadirectory' => '/usr/local/www/nextcloud/data',
  'dbtype' => 'mysql',
  'version' => '',
  'overwrite.cli.url' => 'https://my.domain.com',
  'overwriteprotocol' => 'https',
  'overwritehost' => '',
  'dbname' => 'nextcloud',
  'dbhost' => 'localhost',
  'dbport' => '',
  'dbtableprefix' => 'oc_',
  'mysql.utf8mb4' => true,
  'dbuser' => 'localadmin',
  'dbpassword' => 'xxx',
  'installed' => true,
  'instanceid' => '666',
  'maintenance' => false,
  'theme' => '',
  'simpleSignUpLink.shown' => false,
  'loglevel' => 3,
  'app_install_overwrite' => 
  array (
    0 => 'dropit',

Can’t anyone help??

How exactley did you test this? Is the device you are testing from really connected to a seperate internet connection? (e.g. mobile connection) What does my.domain.com resolve to if you ask an external web based resolver like http://network-tools.com/nslook/ ?

Sorry i can not really help you.

I think this is not correct because “https” uses port 443 and not port 12345.
Perhaps you must modify it.

Please use - if possible - the default port 443 and e.g. Lets Encrypt certificates.

Do you use Dropit? Please delete it. There some problems with it. Support only till version Nextcloud 18.

Yes. I have other services that are perfectly reachable by all users.

It is called port forwarding. It’s a basic if you use multiple webservers at the same ip.

I don’t use it. It was disabled but now I removed it but no change.

I would think about setting up a reverse proxy for that purpose. Probably more secure and easier to handle from a users perspective (no need to add ports to the URL)

Then it has maybe something to do with the Overwrite parameters in the config.php. Can’t really help with that, since I never used diffrent ports on the external URL than on the internal one. Matter of fact I use the “external” URL everywhere, without any port remapping for external access.