Internal IP address instead of external url

Hello,

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:
    10.18.146.230/nextcloud/login/v2/flow/olZsN3JjkyFEfZeeW89n27iS7irophiqRq2tB3bbmGQH7XBtweOWbcr1NLavyxxxxxZucLbM3QQ6ogyvAfTrpNcHFezE7nP80lGTxmrL7PXNoPjY8EhGJlEbj4w

not like:

www.example.com/nextcloud/login/v2/flow/olZsN3JjkyFEfZeeW89n27iS7irophiqRq2tB3bbmGQH7XBtweOWbcr1NLavyRPc9g91GrMZucLbM3QQ6ogyvAfTrpNcHFezE7nP80lGTxmrL7PXNoPjY8EhGJlEbj4w

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

10.18.146.230/nextcloud/apps/spreed/

not for:

www.example.com/nextcloud/apps/spreed/

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

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!):

<?php
$CONFIG = array (
  'instanceid' => 'xxxxxxxxxxxxxxxx',
  'passwordsalt' => 'xxxxxxxxxxxxx',
  'secret' => 'xxxxxxxxxxxxxxxxxxxxxxxxxxx',
  'trusted_domains' =>
  array (
    0 => 'www.example.com',
    1 => '10.18.146.230',
  ),
  'datadirectory' => '/var/www/nextcloud/data',
  'dbtype' => 'mysql',
  'version' => '21.0.0.18',
  'overwrite.cli.url' => 'https://www.example.com/nextcloud',
  '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.example.com',
  'mail_from_address' => 'admin',
  'mail_domain' => 'mail.example.com',
  'mail_smtpsecure' => 'tls',
  'mail_smtpauth' => 1,
  'mail_smtpname' => 'admin@mail.example.com',
  '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

Regards

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 (
0 => ‘YOUR_NC_DOMAIN_HERE’,
),
‘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.