Redirect after login with domain not working


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 ( When I’m outside, I want to access it via I’m running everything behind a nginx reverse proxy and the redirect itself is working fine. I can access the GUI via

When I go to and login, the wheel just turns, but I’m not redicrected. When I refresh the paged, I’m logged in.

When I go to and login, everything works fine.

I assume my redirect is broken. Here my config:

$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 => '',
    1 => '',
  'trusted_proxies' =>
  array (
    0 => '',
  'datadirectory' => '/var/www/html/data',
  'dbtype' => 'mysql',
  'version' => '',
  'overwrite.cli.url' => '',
  'overwrite.cli.url' => '',
  'dbname' => 'nextcloud',
  'dbhost' => 'mariadb',
  'dbport' => '',
  'dbtableprefix' => 'oc_',
  'mysql.utf8mb4' => true,
  'dbuser' => 'xxx',
  'dbpassword' => 'xxx',
  'installed' => true,

I tried with and without 'overwrite.cli.url' => '',,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 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

Scheme: http
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?