Nextcloud Redirects from https to http in specific cases

Hi,

I just set up my own nextcloud instance using the docker-compose from the docker documentation (but with some changes to the volumes). I’m running this instance behind a custom reverse proxy (for ssl termination and subdomain routing) and manged to configure everything so far but whenever I try to access the base url (https://cloud.example.com/) it redirects me to the non-https version of the site I should be redirected to (http://cloud.example.com/login for non logged in user or http://cloud.example.com/apps/dashboard for logged in users), everything else works so far.

The server returns http status 302 and points towards either of the http urls mentioned above.

I also noticed that chrome complains about the start_url in the manifest being http while I’m on the https version of it: Manifest: property 'start_url' ignored, should be same origin as document.

I’m not sure if this is relevant but for some reason my instance uses ‘pretty urls’ (so no index.php) without enabling it, could it be that inside the app there is only html5 routing and therefore no problems with http/https? Or is it something else I’m missing?

Here is my current config (with domains and ips being replaced and passwords removed):

<?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' => '1234',
  'trusted_domains' =>
  array (
    0 => 'cloud.example.com',
  ),
  'trusted_proxies' =>
  array (
    0 => '192.168.178.1',
  ),
  'overwrite.cli.url' => 'https://cloud.example.com/',
  'overwriteprotocol' => 'https',
  'overwritehost' => 'cloud.example.com',
  'overwritecondaddr' => '^192\\.168\\.178\\.1$',
  'passwordsalt' => 'somesalt',
  'secret' => 'somesecret',
  'datadirectory' => '/var/www/html/data',
  'dbtype' => 'mysql',
  'version' => '20.0.5.2',
  'dbname' => 'nextcloud',
  'dbhost' => 'db',
  'dbport' => '',
  'dbtableprefix' => 'oc_',
  'mysql.utf8mb4' => true,
  'dbuser' => 'user',
  'dbpassword' => 'password',
  'installed' => true,
);

Thanks in advance!

Found the solution: overwritecondaddr and overwriteprotocol somehow don’t go well together, deleted overwritecondaddr and it works like a charm