Login only redirects after page refresh in Chrome/Edge

Nextcloud version: 20.0.6.1
Operating system and version: Ubuntu 18.04.4 LTS
Apache or nginx version: Apache 2.4.41
PHP version: not present (the command "php -v" did nothing, php probably not necessary because of snap)

The issue you are facing:

Is this the first time you’ve seen this error?: Y

Steps to replicate it:

  1. Attempt to login with any user account using the latest version of Chrome or Edge.
  2. The ‘cirlce’ will continue to spin and the user isn’t logged in.
  3. Hitting refresh in the browser allows the user to login.

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


<?php
$CONFIG = array (
  'apps_paths' =>
  array (
    0 =>
    array (
      'path' => '/snap/nextcloud/current/htdocs/apps',
      'url' => '/apps',
      'writable' => false,
    ),
    1 =>
    array (
      'path' => '/var/snap/nextcloud/current/nextcloud/extra-apps',
      'url' => '/extra-apps',
      'writable' => true,
    ),
  ),
  'supportedDatabases' =>
  array (
    0 => 'mysql',
  ),
  'memcache.locking' => '\\OC\\Memcache\\Redis',
  'memcache.local' => '\\OC\\Memcache\\Redis',
  'redis' =>
  array (
    'host' => '/tmp/sockets/redis.sock',
    'port' => 0,
  ),
  'instanceid' => 'instanceid',
  'passwordsalt' => 'passwordsalt',
  'secret' => 'secret',
  'trusted_domains' =>
  array (
    0 => 'hostIP',
    1 => 'sub.domain.eu',
  ),
  'trusted_proxies' =>
  array (
    0 => 'reverseproxyIP',
  ),
  'datadirectory' => '/var/snap/nextcloud/common/nextcloud/data',
  'dbtype' => 'mysql',
  'version' => '20.0.6.1',
  'overwrite.cli.url' => 'https://sub.domain.eu/',
  'overwriteprotocol' => 'https',
  'overwritehost' => 'sub.domain.eu',
  'dbname' => 'nextcloud',
  'dbhost' => 'localhost:/tmp/sockets/mysql.sock',
  'dbport' => '',
  'dbtableprefix' => 'oc_',
  'mysql.utf8mb4' => true,
  'dbuser' => 'nextcloud',
  'auth.bruteforce.protection.enabled' => false,
  'dbpassword' => 'dbpw',
  'installed' => true,
  'loglevel' => 2,
  'maintenance' => false,
  'ldapIgnoreNamingRules' => false,
  'ldapProviderFactory' => 'OCA\\User_LDAP\\LDAPProviderFactory',
  'mail_smtpmode' => 'smtp',
  'mail_sendmailmode' => 'smtp',
  'mail_from_address' => 'no-reply',
  'mail_domain' => 'domain.eu',
  'mail_smtphost' => 'mailhostIP',
  'mail_smtpport' => '25',
);

I have used snap to install Nextcloud.
A reverse proxy is present which also runs Ubuntu and Apache.

The things i tried so far are:

Changing

`'overwrite.cli.url' => 'https://domain.lu', {...}`

to

`{...}
 'overwrite.cli.url' => 'https://domain.lu',
 'overwritehost' => 'domain.lu',
 'overwriteprotocol' => 'https',
 {...}`

As it was recommended from this post: Nextcloud Login Issue Google Chrome

Adding a trusted proxy with the line

'trusted_proxies' => 
array (
  0 => 'nginxiphere'
),

As recommended in this post: Weird web login issue also preventing app sync

Removing the line

'overwritecondaddr',

As recommended in this post: Login and grant access hangs on fresh NC18 Docker install · Issue #19091 · nextcloud/server · GitHub

Nothing has worked so far.
I did multiple restarts and also always cleared the cache of my browsers after each change.

Is this some issue with installing Nextcloud from snap?