Nextcloud changing my collabora server url from https to http

Nextcloud version: 28.0.3
Operating system and version: Ubuntu 22.04 using Umbrel (umbrel.com)
Also using Cloudflare Tunnel

The issue you are facing:
Nextcloud replaces my Collabora Online Url with the HTTP Version of it which then throws an error in the browser due to the HTTP/HTTPS mismatch.

Is this the first time you’ve seen this error? (Y/N):
Y

my config.php (removed irrelevant parts):

  'overwriteprotocol' => 'https',
  'htaccess.RewriteBase' => '/',
  'trusted_proxies' =>
  array (
    0 => '"10.21.0.0/16"',
  ),
  'upgrade.disable-web' => true,
  'trusted_domains' =>
  array (
    0 => 'localhost',
),
  'datadirectory' => '/var/www/html/data',
  'dbtype' => 'mysql',
  'version' => '28.0.3.2',
  'overwrite.cli.url' => 'https://cloud.example.org/',
  'dbname' => 'nextcloud',
  'dbhost' => 'nextcloud_db_1',
  'dbport' => '',
  'dbtableprefix' => 'oc_',
  'mysql.utf8mb4' => true,
  'dbuser' => 'nextcloud',
  'installed' => true,```

Did the collabora server ever worked for you, or is this a fresh installation?

First things first, test that the collabora listens on the TLS and that your coolwsd.xml config file is OK.

Then test the collabora endpoint https://<your collabora server hostname/IP>/hosting/capabilities with curl or in the browser, the curl output should look like this:

The likely suspects here:
does your collabora runs TLS?
Is it behind reverse proxy - does the termination run OK
Do you terminate at the reverse proxy, or at the collabora itself (did you provide and configure certificates)
Did you enable calls to Collabora from your Nextcloud server (IP/hostname whitelisting in the coolwsd.xml)
Does it respond to the /hosting/capabilities endpoint (with curl) ok at least by HTTP?

Based on the limited information, I suspect this is likely a configuration on the Collabora side itself, not necessarily on the Nextcloud side: based on my epxerience, when Collabora works and is configured for TLS (either direct or terminated at reverse proxy), it works fine and Nextcloud picks it up correctly.