Share links showing local IP instead of public FQDN (Tech and Me Appliance)

Support intro

Sorry to hear you’re facing problems :slightly_frowning_face:

help.nextcloud.com is for home/non-enterprise users. If you’re running a business, paid support can be accessed via portal.nextcloud.com where we can ensure your business keeps running smoothly.

In order to help you as quickly as possible, before clicking Create Topic please provide as much of the below as you can. Feel free to use a pastebin service for logs, otherwise either indent short log examples with four spaces:

example

Or for longer, use three backticks above and below the code snippet:

longer
example
here

Some or all of the below information will be requested if it isn’t supplied; for fastest response please provide as much as you can :heart:

Nextcloud version (eg, 12.0.2): 16.0.0
Operating system and version (eg, Ubuntu 17.04): 18.04.2 LTS
Apache or nginx version (eg, Apache 2.4.25): Apache/2.4.29 (Ubuntu)
PHP version (eg, 7.1): 7.2.17-0ubuntu0.18.04.1

The issue you are facing: I am using the Tech & Me appliance of Nextcloud and am running into an issue where share links are giving the private IP address instead of the public FQDN in the copied URL. If I change the URL to have the public FQDN, I can access the site remotely, but the download button still points to the local IP address, thus making the file inaccessible outside the network.

This is the URL I am getting:
http://10.0.0.5/nextcloud/index.php/s/F2oWoe75CjwpB8T

This is the URL I should be getting:
http://sub.domain.tld/nextcloud/index.php/s/F2oWoe75CjwpB8T

I have tried adding ‘overwritehost’ => ‘sub.domain.tld’,to my config file in /var/www/nextcloud/config/config.php but this did not fix the issue.

Is this the first time you’ve seen this error? (Y/N): No. This error has been happening for several versions.

Steps to replicate it:

  1. Go to file
  2. Click on Share
  3. Click on Copy to Clipboard button

The output of your Nextcloud log in Admin > Logging:

Will post if needed

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

<?php
$CONFIG = array (
  'passwordsalt' => xxx',
  'secret' => xxx',
  'trusted_domains' => 
  array (
    0 => 'localhost',
    1 => '10.0.0.5',
    2 => 'nextcloud',
    3 => 'nextcloud',
    4 => '10.0.0.1',
    5 => '10.0.0.4',
    6 => 'sub.domain.tld',
  ),
  'datadirectory' => '/mnt/ncdata',
  'overwrite.cli.url' => 'https://nextcloud/',
  'overwrite.host' => ‘sub.domain.tld’,
  'dbtype' => 'pgsql',
  'version' => '16.0.0.9',
  'dbname' => 'nextcloud_db',
  'dbhost' => 'localhost',
  'dbport' => '',
  'dbtableprefix' => 'oc_',
  'dbuser' => 'ncadmin',
  'dbpassword' => 'xxx',
  'installed' => true,
  'instanceid' => 'oczmkboktq1y',
  'mail_smtpmode' => 'smtp',
  'log_rotate_size' => '10485760',
  'memcache.local' => '\\OC\\Memcache\\Redis',
  'filelocking.enabled' => true,
  'memcache.distributed' => '\\OC\\Memcache\\Redis',
  'memcache.locking' => '\\OC\\Memcache\\Redis',
  'redis' => 
  array (
    'host' => '/var/run/redis/redis-server.sock',
    'port' => 0,
    'timeout' => 0.5,
    'dbindex' => 0,
    'password' => 'xxx',
  ),
  'htaccess.RewriteBase' => '/',
  'maintenance' => false,
  'mail_smtpsecure' => 'tls',
  'mail_smtpauthtype' => 'LOGIN',
  'mail_from_address' => 'xxx',
  'mail_domain' => 'gmail.com',
  'mail_smtpauth' => 1,
  'mail_smtphost' => 'smtp.gmail.com',
  'mail_smtpport' => '587',
  'mail_smtpname' => 'xxx',
  'mail_smtppassword' => 'xxx',
  'loglevel' => 2,
);

The output of your Apache/nginx/system log in /var/log/____:

Will post if needed

Anybody run into this issue or have a suggestion on how to fix this? I cannot figure this out.

Not sure but give it a try:

nextcloud/config.php
'overwrite.cli.url' => 'https://nextcloud/',

instead of “nextcloud” you should enter your own domain…

I just tried doing that. It’s still giving me the same problem. Perhaps I will just try redeploying the appliance from scratch. Not really sure what else to do.

Can you please post your apache config?

Which URI did you log into to share? I had the same issue when logging in using my local IP but when I use my domain it appears to share using the domain