Internal IP address instead of external url


Nextcloud version (eg, 20.0.5): 21.0
Operating system and version (eg, Ubuntu 20.04): Debian 10
Apache or nginx version (eg, Apache 2.4.25): Apache/2.4.38 (Debian)
PHP version (eg, 7.4): PHP 7.3.27-1~deb10u1

The issue you are facing:

After configuring Nextcloud, I can access the panel via an external url, but:

  1. if I want to configure the Nextcloud application, the browser, in order to confirm the authorization, directs me to the address containing the local IP address of the server on which Nextcloud is installed instead of the URL - it’s looks like:

not like:

  1. the “conversation” application gives a local IP address as a link instead of a URL:

not for:

  1. on the settings page in the “Server Address” section, there is an internal IP address - how to change it to the URL []?

Can I ask for advice to correct these errors and change IP for URL?

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

Steps to replicate it:

The output of your Nextcloud log in Admin > Logging:

no logs because the browser is directed to the wrong address

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

$CONFIG = array (
  'instanceid' => 'xxxxxxxxxxxxxxxx',
  'passwordsalt' => 'xxxxxxxxxxxxx',
  'secret' => 'xxxxxxxxxxxxxxxxxxxxxxxxxxx',
  'trusted_domains' =>
  array (
    0 => '',
    1 => '',
  'datadirectory' => '/var/www/nextcloud/data',
  'dbtype' => 'mysql',
  'version' => '',
  'overwrite.cli.url' => '',
  'htaccess.RewriteBase' => '/nextcloud',
  'dbname' => 'nextclouddb',
  'dbhost' => 'localhost',
  'dbport' => '',
  'dbtableprefix' => 'oc_',
  'mysql.utf8mb4' => true,
  'dbuser' => 'nextcloud',
  'dbpassword' => 'xxxxxxxxxxxxxx',
  'installed' => true,
  'mail_smtpmode' => 'smtp',
  'mail_smtpport' => '587',
  'mail_sendmailmode' => 'smtp',
  'mail_smtphost' => '',
  'mail_from_address' => 'admin',
  'mail_domain' => '',
  'mail_smtpsecure' => 'tls',
  'mail_smtpauth' => 1,
  'mail_smtpname' => '',
  'mail_smtppassword' => 'xxxxxxxxxxxxx',
  'mail_smtpauthtype' => 'LOGIN',
  'maintenance' => false,
  'logfile' => '/var/log/nextcloud.log',
  'loglevel' => 0,
  'log_rotate_size' => 100 * 1024 * 1024

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

no logs because the browser is directed to the wrong address


i think your problem is already discussed here in the forum. or?

Is not my cases…:frowning:

Hi Lukasz,

try to add the following in your config:

‘trusted_domains’ =>
array (
‘overwrite.cli.url’ => ‘https://YOUR_NC_DOMAIN_HERE’,
‘overwriteprotocol’ => ‘https’,
‘overwritehost’ => ‘YOUR_NC_DOMAIN_HERE’,

PS: You may need to add your NC domain Port with :PORT_NUMBER

I hope this helps

Try removing the ip address in your trusted_domains.

Also post your apache config.