Proxy Issue with overwriteprotocol https in Nextcloud Settings for Collabora Online - Built-in CODE Server (/settings/user/richdocuments)


I see an issue to configure The “Collabora Online - Built-in CODE Server” under “/settings/user/richdocuments” behind a proxy.

The Build in Server works without the reverse SSL proxy, but it is not possible to set the right the settings for the “/settings/user/richdocuments”.

If I choose “Use built in …” the Check is green and when I klick into “Use own…” it shows the right URL with https. I press the save button too. But after reload it points again to http.
It seems, that the “/settings/user/richdocuments” does not handle the “X-Forward-Forwarted-Ssl” or “X-Forward-Forwarted-Proto” header or it ignores the “‘overwriteprotocol’ => ‘https’,” setting in “/config/config.php”

If I set “SetEnv HTTPS on” in /.htaccess ist works like a charm.

That means, the “/custom_apps/richdocumentscode/proxy.php” is not affected . Only the configuration of the built in Collabora inside Nextcloud fails at the http isntead of https.
The hostname as set in ‘overwritehost’ works.

nginx config:

server {
    listen 443 ssl;
    ssl_certificate /etc/letsencrypt/live/;
    ssl_certificate_key /etc/letsencrypt/live/;

    location /  {

        # collabora server websocket
        proxy_http_version 1.1;
        proxy_set_header Upgrade $http_upgrade;
        proxy_set_header Connection "Upgrade";
        proxy_set_header Host "";
        proxy_set_header X-Forwarded-Proto "https";



  'overwritehost' => '',
  'overwriteprotocol' => 'https',
  'overwritecondaddr' => '^192\\.168\\.0\\.100$',

I have the exact same issue here on NC 23.0.2.

My browsers console gives me this error:
Mixed Content: The page at '' was loaded over HTTPS, but requested an insecure form action 'http://xxxx.XXX,.XXX.XXX/apps/richdocumentscode/proxy.php?req=/browser/e8ac597/cool.html?'. This request has been blocked; the content must be served over HTTPS.

If I try to open a document I see the spinner and then get this error:
“Document loading failed”
“Failed to load Nextcloud Office - please try again later”

  • Collabora Online - Built-in CODE Server 21.11.204
  • Nextcloud Office 5.0.3

This is your workaround?

Yes, it is:

adding the line SetEnv HTTPS on to .htaccess

But it will removed on every update.

Hi @augustusburg

You can refer to the configuration in my article.

Use HTTPS with Ubuntu 22.04, apache, Nextcloud and Collabora(Docker)