Wrong domain in password reset link

Nextcloud version: 17.0.3
Apache
PHP version: 7.3.11

The issue you are facing:
If a user wants to reset his password, the URL of the password reset link is broken. The link in the password reset email contains two dots between the third and second level domain and looks like this: https://nextcloud…example.com/index.php/lostpassword/reset/form/12345/username
(the third dot is inserted by the forum software, the password reset link contains only two dots between nextcloud and example)

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

<?php
$CONFIG = array (
  'instanceid' => '12345',
  'passwordsalt' => '12345',
  'secret' => '12345',
  'trusted_domains' => 
  array (
    0 => 'nextcloud.example.com',
  ),
  'datadirectory' => '/www/htdocs/nextcloud/nc_data',
  'dbtype' => 'mysql',
  'version' => '17.0.3.1',
  'default_language' => 'de',
  'default_locale' => 'de',
  'dbname' => 'dbname',
  'dbhost' => 'localhost',
  'dbport' => '',
  'dbtableprefix' => 'oc_',
  'mysql.utf8mb4' => true,
  'dbuser' => 'user',
  'dbpassword' => 'pass',
  'installed' => true,
  'mail_smtpmode' => 'sendmail',
  'mail_sendmailmode' => 'pipe',
  'mail_from_address' => 'webmaster',
  'mail_domain' => 'example.com',
  'theme' => '',
  'loglevel' => 2,
  'maintenance' => false,
  'skeletondirectory' => '',
  'app_install_overwrite' => 
  array (
    0 => 'polls',
  ),
  'mail_smtphost' => 'mail.example.com',
  'mail_smtpport' => '25',
  'updater.secret' => '12345',
);

I currently have the same problem, but can’t find a solution.

There is an option in the config file that you can set this value:

/**
 * The automatic hostname detection of Nextcloud can fail in certain reverse
 * proxy and CLI/cron situations. This option allows you to manually override
 * the automatic detection; for example ``www.example.com``, or specify the port
 * ``www.example.com:8080``.
 */
'overwritehost' => '',