Redirect after login with domain not working

Hello,

I’m running the latest NC instance in docker on my Raspberry Pi. When I’m home, I’m accessing it via http and the internal IP (192.168.178.36:8086). When I’m outside, I want to access it via https://cloud.domain.com. I’m running everything behind a nginx reverse proxy and the redirect itself is working fine. I can access the GUI via https://cloud.domain.com.

When I go to https://cloud.domain.com and login, the wheel just turns, but I’m not redicrected. When I refresh the paged, I’m logged in.

When I go to 192.168.178.36:8086 and login, everything works fine.

I assume my redirect is broken. Here my config:

<?php
$CONFIG = array (
  'htaccess.RewriteBase' => '/',
  'memcache.local' => '\\OC\\Memcache\\APCu',
  'apps_paths' =>
  array (
    0 =>
    array (
      'path' => '/var/www/html/apps',
      'url' => '/apps',
      'writable' => false,
    ),
    1 =>
    array (
      'path' => '/var/www/html/custom_apps',
      'url' => '/custom_apps',
      'writable' => true,
    ),
  ),
  'instanceid' => 'xxx',
  'passwordsalt' => 'xxx',
  'secret' => 'xxx',
  'trusted_domains' =>
  array (
    0 => '192.168.178.36:8086',
    1 => 'cloud.domain.com',
  ),
  'trusted_proxies' =>
  array (
    0 => '192.168.178.54',
  ),
  'datadirectory' => '/var/www/html/data',
  'dbtype' => 'mysql',
  'version' => '23.0.0.10',
  'overwrite.cli.url' => 'http://192.168.178.36:8086',
  'overwrite.cli.url' => 'https://cloud.domain.com',
  'dbname' => 'nextcloud',
  'dbhost' => 'mariadb',
  'dbport' => '',
  'dbtableprefix' => 'oc_',
  'mysql.utf8mb4' => true,
  'dbuser' => 'xxx',
  'dbpassword' => 'xxx',
  'installed' => true,
);

I tried with and without 'overwrite.cli.url' => 'https://cloud.domain.com',,same result.

Refreshing the website to be logged in isn’t that big of a deal. The bigger concern I have is that I cannot login on my NC mobile app, at least not to https://cloud.domain.com. I can login using the IP, but when I use the domain, it says:

strict mode no http connection allowed

Here my nginx proxy settings for cloud.domain.com:

Scheme: http
IP: 192.168.178.36
Post: 8086

Cache Assets: Off
Block Common Exploits: On
Websockets Support: On

Force SSL: On
HTTP/2 Support: On
HSTS Enabled: On
HSTS SUbdomains: On

Any ideas?

Greetings