Talk url uses LAN IP

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.1
Operating system and version (eg, Ubuntu 17.04): DietPi v6.24.1
Apache or nginx version (eg, Apache 2.4.25): lighttpd 1.4.45
PHP version (eg, 7.1): 7.3.5

The issue you are facing:
Hello,
This is my first ever post, I did some serious searching, but couldn’t find a similar thread, but apologies if I missed it.

The issue I’m facing is that the link used by nextcloud talk is the LAN IP of the server it is hosted on, rather than the public domain. This shows up in 2 places:

  1. at the top navigation menu throughout nextcloud
  2. when it copies a URL to share

I am 100% sure it’s due to me messing up the installation, but I have no idea how to fix it. Any suggestions?

Thank you for your help in advance!

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

  1. Click on talk icon in the top navigation
  2. Goes to talk, but using local IP (ie my 192.168.. IP)
  3. Click on share
  4. Shares link using local IP

The output of your Nextcloud log in Admin > Logging:

{"reqId":"aAdoFJ3m1i9LjJkpGTWi","level":2,"time":"2019-05-27T20:24:38+00:00","remoteAddr":"192.168.1.37","user":"--","app":"core","method":"POST","url":"\/nextcloud\/index.php\/login","message":"Login failed: 'root' (Remote IP: '192.168.1.37')","userAgent":"Mozilla\/5.0 (Macintosh; Intel Mac OS X 10_14_5) AppleWebKit\/537.36 (KHTML, like Gecko) Chrome\/74.0.3729.169 Safari\/537.36","version":"16.0.1.1"}
{"reqId":"X968VL4ZEmzuJXyO2Hli","level":2,"time":"2019-05-27T20:24:43+00:00","remoteAddr":"192.168.1.37","user":"--","app":"core","method":"POST","url":"\/nextcloud\/index.php\/login?user=root","message":"Login failed: 'root' (Remote IP: '192.168.1.37')","userAgent":"Mozilla\/5.0 (Macintosh; Intel Mac OS X 10_14_5) AppleWebKit\/537.36 (KHTML, like Gecko) Chrome\/74.0.3729.169 Safari\/537.36","version":"16.0.1.1"}
{"reqId":"g4gp1bA0IccJNNwoiB4i","level":2,"time":"2019-05-27T20:24:55+00:00","remoteAddr":"192.168.1.37","user":"--","app":"core","method":"POST","url":"\/nextcloud\/index.php\/login?user=root","message":"Login failed: 'admin' (Remote IP: '192.168.1.37')","userAgent":"Mozilla\/5.0 (Macintosh; Intel Mac OS X 10_14_5) AppleWebKit\/537.36 (KHTML, like Gecko) Chrome\/74.0.3729.169 Safari\/537.36","version":"16.0.1.1"}
{"reqId":"ZtlFlirGxr1VPqr6ikb8","level":2,"time":"2019-05-27T20:25:02+00:00","remoteAddr":"192.168.1.37","user":"--","app":"core","method":"POST","url":"\/nextcloud\/index.php\/login?user=admin","message":"Login failed: 'admin' (Remote IP: '192.168.1.37')","userAgent":"Mozilla\/5.0 (Macintosh; Intel Mac OS X 10_14_5) AppleWebKit\/537.36 (KHTML, like Gecko) Chrome\/74.0.3729.169 Safari\/537.36","version":"16.0.1.1"}
{"reqId":"o18vsWUJKwXbEzChh5KK","level":3,"time":"2019-05-27T20:54:10+00:00","remoteAddr":"192.168.1.47","user":"admin","app":"ocs_api","method":"POST","url":"\/nextcloud\/ocs\/v2.php\/cloud\/users","message":{"Exception":"Swift_TransportException","Message":"Connection could not be established with host 127.0.0.1 [Connection refused #111]","Code":0,"Trace":[{"file":"\/var\/www\/nextcloud\/3rdparty\/swiftmailer\/swiftmailer\/lib\/classes\/Swift\/Transport\/StreamBuffer.php","line":58,"function":"establishSocketConnection","class":"Swift_Transport_StreamBuffer","type":"->","args":[]},{"file":"\/var\/www\/nextcloud\/3rdparty\/swiftmailer\/swiftmailer\/lib\/classes\/Swift\/Transport\/AbstractSmtpTransport.php","line":143,"function":"initialize","class":"Swift_Transport_StreamBuffer","type":"->","args":[{"protocol":"","host":"127.0.0.1","port":25,"timeout":10,"blocking":1,"tls":false,"type":1,"stream_context_options":[]}]},{"file":"\/var\/www\/nextcloud\/3rdparty\/swiftmailer\/swiftmailer\/lib\/classes\/Swift\/Mailer.php","line":65,"function":"start","class":"Swift_Transport_AbstractSmtpTransport","type":"->","args":[]},{"file":"\/var\/www\/nextcloud\/lib\/private\/Mail\/Mailer.php","line":180,"function":"send","class":"Swift_Mailer","type":"->","args":[{"__class__":"Swift_Message"},[]]},{"file":"\/var\/www\/nextcloud\/settings\/Mailer\/NewUserMailHelper.php","line":169,"function":"send","class":"OC\\Mail\\Mailer","type":"->","args":[{"__class__":"OC\\Mail\\Message"}]},{"file":"\/var\/www\/nextcloud\/apps\/provisioning_api\/lib\/Controller\/UsersController.php","line":307,"function":"sendMail","class":"OC\\Settings\\Mailer\\NewUserMailHelper","type":"->","args":[{"__class__":"OC\\User\\User"},{"__class__":"OC\\Mail\\EMailTemplate"}]},{"file":"\/var\/www\/nextcloud\/lib\/private\/AppFramework\/Http\/Dispatcher.php","line":166,"function":"addUser","class":"OCA\\Provisioning_API\\Controller\\UsersController","type":"->","args":["*** sensitive parameters replaced ***"]},{"file":"\/var\/www\/nextcloud\/lib\/private\/AppFramework\/Http\/Dispatcher.php","line":99,"function":"executeController","class":"OC\\AppFramework\\Http\\Dispatcher","type":"->","args":[{"__class__":"OCA\\Provisioning_API\\Controller\\UsersController"},"addUser"]},{"file":"\/var\/www\/nextcloud\/lib\/private\/AppFramework\/App.php","line":126,"function":"dispatch","class":"OC\\AppFramework\\Http\\Dispatcher","type":"->","args":[{"__class__":"OCA\\Provisioning_API\\Controller\\UsersController"},"addUser"]},{"file":"\/var\/www\/nextcloud\/lib\/private\/AppFramework\/Routing\/RouteActionHandler.php","line":47,"function":"main","class":"OC\\AppFramework\\App","type":"::","args":["OCA\\Provisioning_API\\Controller\\UsersController","addUser",{"__class__":"OC\\AppFramework\\DependencyInjection\\DIContainer"},{"_route":"ocs.provisioning_api.Users.addUser"}]},{"function":"__invoke","class":"OC\\AppFramework\\Routing\\RouteActionHandler","type":"->","args":[{"_route":"ocs.provisioning_api.Users.addUser"}]},{"file":"\/var\/www\/nextcloud\/lib\/private\/Route\/Router.php","line":297,"function":"call_user_func","args":[{"__class__":"OC\\AppFramework\\Routing\\RouteActionHandler"},{"_route":"ocs.provisioning_api.Users.addUser"}]},{"file":"\/var\/www\/nextcloud\/ocs\/v1.php","line":82,"function":"match","class":"OC\\Route\\Router","type":"->","args":["\/ocsapp\/cloud\/users"]},{"file":"\/var\/www\/nextcloud\/ocs\/v2.php","line":24,"args":["\/var\/www\/nextcloud\/ocs\/v1.php"],"function":"require_once"}],"File":"\/var\/www\/nextcloud\/3rdparty\/swiftmailer\/swiftmailer\/lib\/classes\/Swift\/Transport\/StreamBuffer.php","Line":269,"CustomMessage":"Can't send new user mail to mike@zimonyi.com"},"userAgent":"Mozilla\/5.0 (Macintosh; Intel Mac OS X 10_14_5) AppleWebKit\/537.36 (KHTML, like Gecko) Chrome\/74.0.3729.169 Safari\/537.36","version":"16.0.1.1"}
{"reqId":"o18vsWUJKwXbEzChh5KK","level":3,"time":"2019-05-27T20:54:10+00:00","remoteAddr":"192.168.1.47","user":"admin","app":"ocs_api","method":"POST","url":"\/nextcloud\/ocs\/v2.php\/cloud\/users","message":{"Exception":"OCP\\AppFramework\\OCS\\OCSException","Message":"Unable to send the invitation mail","Code":109,"Trace":[{"file":"\/var\/www\/nextcloud\/lib\/private\/AppFramework\/Http\/Dispatcher.php","line":166,"function":"addUser","class":"OCA\\Provisioning_API\\Controller\\UsersController","type":"->","args":["*** sensitive parameters replaced ***"]},{"file":"\/var\/www\/nextcloud\/lib\/private\/AppFramework\/Http\/Dispatcher.php","line":99,"function":"executeController","class":"OC\\AppFramework\\Http\\Dispatcher","type":"->","args":[{"__class__":"OCA\\Provisioning_API\\Controller\\UsersController"},"addUser"]},{"file":"\/var\/www\/nextcloud\/lib\/private\/AppFramework\/App.php","line":126,"function":"dispatch","class":"OC\\AppFramework\\Http\\Dispatcher","type":"->","args":[{"__class__":"OCA\\Provisioning_API\\Controller\\UsersController"},"addUser"]},{"file":"\/var\/www\/nextcloud\/lib\/private\/AppFramework\/Routing\/RouteActionHandler.php","line":47,"function":"main","class":"OC\\AppFramework\\App","type":"::","args":["OCA\\Provisioning_API\\Controller\\UsersController","addUser",{"__class__":"OC\\AppFramework\\DependencyInjection\\DIContainer"},{"_route":"ocs.provisioning_api.Users.addUser"}]},{"function":"__invoke","class":"OC\\AppFramework\\Routing\\RouteActionHandler","type":"->","args":[{"_route":"ocs.provisioning_api.Users.addUser"}]},{"file":"\/var\/www\/nextcloud\/lib\/private\/Route\/Router.php","line":297,"function":"call_user_func","args":[{"__class__":"OC\\AppFramework\\Routing\\RouteActionHandler"},{"_route":"ocs.provisioning_api.Users.addUser"}]},{"file":"\/var\/www\/nextcloud\/ocs\/v1.php","line":82,"function":"match","class":"OC\\Route\\Router","type":"->","args":["\/ocsapp\/cloud\/users"]},{"file":"\/var\/www\/nextcloud\/ocs\/v2.php","line":24,"args":["\/var\/www\/nextcloud\/ocs\/v1.php"],"function":"require_once"}],"File":"\/var\/www\/nextcloud\/apps\/provisioning_api\/lib\/Controller\/UsersController.php","Line":314,"CustomMessage":"Failed addUser attempt with exception."},"userAgent":"Mozilla\/5.0 (Macintosh; Intel Mac OS X 10_14_5) AppleWebKit\/537.36 (KHTML, like Gecko) Chrome\/74.0.3729.169 Safari\/537.36","version":"16.0.1.1"}
{"reqId":"Kt79HCV1oW5Ex9LS2W2h","level":4,"time":"2019-05-27T20:54:10+00:00","remoteAddr":"192.168.1.47","user":"admin","app":"ocs_api","method":"POST","url":"\/nextcloud\/ocs\/v2.php\/cloud\/users","message":"Failed addUser attempt: User already exists.","userAgent":"Mozilla\/5.0 (Macintosh; Intel Mac OS X 10_14_5) AppleWebKit\/537.36 (KHTML, like Gecko) Chrome\/74.0.3729.169 Safari\/537.36","version":"16.0.1.1"}
{"reqId":"pQejmfRLBUXkaxva8fmx","level":2,"time":"2019-05-27T21:31:44+00:00","remoteAddr":"192.168.1.47","user":"--","app":"core","method":"POST","url":"\/nextcloud\/index.php\/login","message":"Login failed: 'admin' (Remote IP: '192.168.1.47')","userAgent":"Mozilla\/5.0 (Macintosh; Intel Mac OS X 10_14_5) AppleWebKit\/537.36 (KHTML, like Gecko) Chrome\/74.0.3729.169 Safari\/537.36","version":"16.0.1.1"}
{"reqId":"8PLBNKqdH3akgTlsxLpL","level":2,"time":"2019-05-27T21:31:59+00:00","remoteAddr":"192.168.1.47","user":"--","app":"core","method":"POST","url":"\/nextcloud\/index.php\/login?user=admin","message":"Login failed: 'admin' (Remote IP: '192.168.1.47')","userAgent":"Mozilla\/5.0 (Macintosh; Intel Mac OS X 10_14_5) AppleWebKit\/537.36 (KHTML, like Gecko) Chrome\/74.0.3729.169 Safari\/537.36","version":"16.0.1.1"}
{"reqId":"yMHfxXm2QN2goh850HeC","level":2,"time":"2019-05-27T22:12:14+00:00","remoteAddr":"192.168.1.47","user":"admin","app":"core","method":"POST","url":"\/nextcloud\/index.php\/login\/confirm","message":"Login failed: 'admin' (Remote IP: '192.168.1.47')","userAgent":"Mozilla\/5.0 (Macintosh; Intel Mac OS X 10_14_5) AppleWebKit\/537.36 (KHTML, like Gecko) Chrome\/74.0.3729.169 Safari\/537.36","version":"16.0.1.1"}
{"reqId":"hyH1WTGTB6bfp7q8zf3D","level":2,"time":"2019-05-27T22:12:21+00:00","remoteAddr":"192.168.1.47","user":"admin","app":"core","method":"POST","url":"\/nextcloud\/index.php\/login\/confirm","message":"Login failed: 'admin' (Remote IP: '192.168.1.47')","userAgent":"Mozilla\/5.0 (Macintosh; Intel Mac OS X 10_14_5) AppleWebKit\/537.36 (KHTML, like Gecko) Chrome\/74.0.3729.169 Safari\/537.36","version":"16.0.1.1"}

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


<?php
$CONFIG = array (
  'passwordsalt' => '[stuff here]',
  'secret' => '[stuff here]',
  'trusted_domains' => 
  array (
    0 => 'localhost',
    1 => '*',
  ),
  'datadirectory' => '/mnt/dietpi_userdata/nextcloud_data',
  'dbtype' => 'mysql',
  'version' => '16.0.1.1',
  'memcache.local' => '\\OC\\Memcache\\APCu',
  'filelocking.enabled' => true,
  'memcache.locking' => '\\OC\\Memcache\\Redis',
  'redis' => 
  array (
    'host' => '/run/redis/redis-server.sock',
    'port' => 0,
  ),
  'overwrite.cli.url' => 'http://zimomonyi.com/nextcloud',
  'dbname' => 'nextcloud',
  'dbhost' => 'localhost',
  'dbport' => '',
  'dbtableprefix' => 'oc_',
  'mysql.utf8mb4' => true,
  'dbuser' => '[stuff here]',
  'dbpassword' => '[stuff here]',
  'installed' => true,
  'instanceid' => '[stuff here]',
  'maintenance' => false,
  'mail_smtpmode' => 'smtp',
  'mail_smtpsecure' => 'ssl',
  'mail_sendmailmode' => 'smtp',
  'mail_from_address' => 'mike',
  'mail_domain' => 'zimonyi.com',
  'mail_smtpauthtype' => 'LOGIN',
  'mail_smtpauth' => 1,
  'mail_smtphost' => 'smtp.gmail.com',
  'mail_smtpport' => '587',
  'mail_smtpname' => '',
  'mail_smtppassword' => '',
);

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


2019-05-27 23:27:35: (log.c.217) server started

I figured it out! In case anyone else is having the same problem, here’s the solution:

  1. Open the config.php file (located at /var/www/nextcloud/config):

sudo nano /var/www/nextcloud/config/config.php

  1. Find the following bit:

$CONFIG = array (
‘passwordsalt’ => ‘some stuff in here’,
‘secret’ => ‘some stuff in here’,
‘trusted_domains’ =>
array (
0 => ‘localhost’,
1 => ‘*’,
),

  1. And add the following line on a new line, right after the ‘secret’… line:

“overwritehost” => “yourdomain.here”,

Obviously, add your domain name instead of yourdomain.here.

So the final version should look like this:

$CONFIG = array (
‘passwordsalt’ => ‘some stuff in here’,
‘secret’ => ‘some stuff in here’,
“overwritehost” => “yourdomain.here”,
‘trusted_domains’ =>
array (
0 => ‘localhost’,
1 => ‘*’,
),

Boom. DONE.

1 Like

BTW, afaik setting trusted_domains to "*" is not correct. It should also be set to your own domain, e.g. “yourdomain.here”, because it defines the name used in the URL to access the Nextcloud server and not the ip address from which access should be allowed.

1 Like

Thank you for spotting!

If I added my domain before I made the changes above, I got an error about untrusted domains. Now with overwritehost there, I can add my domain under trusted domains and it all works now.

Not sure why this is the case, but hey, it works now :slight_smile:

Hi there,

I have done this, but the desktop link to Nextcloud Talk remains the local host’s network IP address.

My Nextcloud deployment is sitting behind a reverse proxy.

This is my config file:

<?php
$CONFIG = array (
  'instanceid' => 'ocy3ml194qsh',
  'passwordsalt' => 'xxxxxxxxxxxxxxxxxxxxxxxxxxx',
  'secret' => 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx',
  'trusted_domains' =>
  array (
    0 => '192.168.x.xxx',
    1 => 'xxxxxxx.xxxxxxxx.xxx',
  ),
  'datadirectory' => '/mnt/md2/nextcloud/data',
  'dbtype' => 'mysql',
  'version' => '23.0.2.1',
  'dbname' => 'nextcloud',
  'dbhost' => 'xxxxxxxxxxxxxx',
  'dbport' => '',
  'dbtableprefix' => 'oc_',
  'mysql.utf8mb4' => true,
  'dbuser' => 'xxxxxxxxx',
  'dbpassword' => 'xxxxxxxxx',
  'installed' => true,
  'memcache.local' => '\\OC\\Memcache\\APCu',
  'filelocking.enabled' => true,
  'memcache.locking' => '\\OC\\Memcache\\Redis',
  'redis' =>
  array (
    'host' => '127.0.0.1',
    'port' => 6379,
  ),
  'default_phone_region' => 'GB',
  0 =>
  array (
    'trusted_proxies' => '192.168.x.xxx',
    'overwritehost' => 'xxxxx.xxxxxxx.xxx',
    'overwriteprotocol' => 'https',
    'overwritewebroot' => '/',
    'overwrite.cli.url' => 'https://xxxx.xxxxxxxx.xxx/',
    'htaccess.RewriteBase' => '/',
  ),
  'forwarded_for_headers' =>
  array (
    0 => 'HTTP_X_FORWARDED_FOR',
    1 => 'HTTP_X_FORWARDED',
  ),
  'mail_smtpmode' => 'smtp',
  'mail_smtpsecure' => 'ssl',
  'mail_sendmailmode' => 'smtp',
  'mail_from_address' => 'xxxxxx',
  'mail_domain' => 'xxxxx.xxx',
  'mail_smtpauthtype' => 'LOGIN',
  'mail_smtpauth' => 1,
  'mail_smtphost' => 'xxx.xxxxxx.xxx',
  'mail_smtpport' => '465',
  'mail_smtpname' => 'admin@xxxxxxx.xxx',
  'mail_smtppassword' => '********',
  'theme' => '',
  'loglevel' => 2,
  'maintenance' => false,
);