Localhost in activity notifications

I keep getting activity notification with an incorrect url with “localhost” in the url: “You are receiving this email because the following things happened at https://localhost”. I can see similar issues that were posted like No/Wrong link in activity email but they do not give the expected solution for me.

I already added ‘overwrite.cli.url’ to my config.php of which I am posting an excerpt below:

<?php $CONFIG = array ( 'trusted_domains' => array ( 0 => 'cloud.owndomain.com', ), 'overwriteprotocol' => 'https', 'overwrite.cli.url' => 'https://cloud.owndomain.com', 'loglevel' => 2, 'maintenance' => false, 'htaccess.RewriteBase' => '/', 'log_rotate_size' => 26214400, 'memcache.local' => '\\OC\\Memcache\\ArrayCache', 'tempdirectory' => '/home/username/tmp/nextcloudtemp', 'enable_previews' => true, 'preview_max_scale_factor' => 1, 'preview_max_x' => 1024, 'preview_max_y' => 1024, 'forcessl' => true, ); Nextcloud 11.0.3 (stable) Users: 6 Files: 74488 PHP Version: 5.6.28 Memory Limit: 512.0 MB Max Execution Time: 3600 Upload max size: 511.0 MB Database Type: mysql Version: 10.1.23 Size: 88.6 MB The output of your Nextcloud log in Admin > Logging: only gives two error messages that seem to be related to the webcron job. These can be also related to this issue, since the webcron job actually also takes care of the activity notification: Error PHP Undefined index: REQUEST_URI at /home/username/public_html/lib/base.php#177 2017-05-15T14:00:05+0200 Error PHP Undefined index: REQUEST_METHOD at /home/username/public_html/lib/private/Route/Router.php#79 Do I have any misconfiguration? Any help is appreciated.

Have you tried to add the 'overwritehost' => '', parameter to the config?

https://docs.nextcloud.com/server/11/admin_manual/configuration_server/config_sample_php_parameters.html#proxy-configurations

Also you might want to check your /etc/hosts file to check if the (external) IP of the server doesn’t resolve to localhost.

1 Like