Perhaps you can test this.
Redirect loop login / Renewing session token failed · Issue #13431 · nextcloud/server · GitHub
So I had to go from (config.php)
{...} 'overwrite.cli.url' => 'https://domain.lu', {...}
to
{...} 'overwrite.cli.url' => 'https://domain.lu', 'overwritehost' => 'domain.lu', 'overwriteprotocol' => 'https', {...}
Perhaps you only need:
overwriteprotocol' => 'https',
Read this entry for redirect http to https for all objects:
Some HTTP links not rewritten to HTTPS despite `'overwriteprotocol' => 'https'` - #12 by anon9582441