NC v22 on Ubuntu 20.04 behind IIS Reverse Proxy - Collabora not starting

Hello,

I am repeatedly despairing of a (hopefully) stupid problem. Background: I have successfully installed NextCloud in the current version 22 as a snap in Ubuntu 20.04 (virtual machine on Server 2022 Hyper-V). I did not install a certificate for NextCloud in the virtual machine. When I access NextCloud in the native installation in Ubuntu using Firefox as localhost, I can open a file in Collabora without any problems.

In the next step, I got a certificate for the NextCloud.myhome.de web page via Letsencypt and installed it on Microsoft IIS. There I set up a reverse proxy configuration using URL rewrite and configured it so that the incoming HTTPS traffic is forwarded as HTTP to the NextCloud server. I can successfully reach the NextCloud server via HTTPS. However, when I now click on a suitable file which should start Collabora, I only get the error message “Error - Failed to open the requested file.” or “Failed to load Collabora Online - please try again later”.

Then I started to research in the hope to adapt the config.php correctly to my situation. Currently I am working with this configuration file (without success):

  • <?php
  • $CONFIG = array (
  • ‘apps_paths’ =>
  • array (
  • 0 => 
    
  • array (
    
  •   'path' => '/snap/nextcloud/current/htdocs/apps',
    
  •   'url' => '/apps',
    
  •   'writable' => false,
    
  • ),
    
  • 1 => 
    
  • array (
    
  •   'path' => '/var/snap/nextcloud/current/nextcloud/extra-apps',
    
  •   'url' => '/extra-apps',
    
  •   'writable' => true,
    
  • ),
    
  • ),
  • ‘supportedDatabases’ =>
  • array (
  • 0 => 'mysql',
    
  • ),
  • ‘memcache.locking’ => ‘\OC\Memcache\Redis’,
  • ‘memcache.local’ => ‘\OC\Memcache\Redis’,
  • ‘redis’ =>
  • array (
  • 'host' => '/tmp/sockets/redis.sock',
    
  • 'port' => 0,
    
  • ),
  • ‘log_type’ => ‘file’,
  • ‘logfile’ => ‘/var/snap/nextcloud/current/logs/nextcloud.log’,
  • ‘logfilemode’ => 416,
  • ‘instanceid’ => ‘oc5n565g8b22’,
  • ‘passwordsalt’ => ‘mnrC8T1xrrTHi0HlzH6QwTCEJ1NrQk’,
  • ‘secret’ => ‘TuvYKqbMTxVVRd4co0miTVPeOhQHB8Tt9B1pgK6CcYbVe81Y’,
  • ‘allow_local_remote_servers’ => true,
  • ‘trusted_domains’ =>
  • array (
  • 0 => '192.168.178.79',
    
  • 1 => 'NextCloud.myhome.de',
    
  • 2 => 'NextCloud',
    
  • ),
  • ‘datadirectory’ => ‘/var/snap/nextcloud/common/nextcloud/data’,
  • ‘dbtype’ => ‘mysql’,
  • ‘version’ => ‘22.2.0.2’,
  • ‘overwrite.cli.url’ => ‘https://NextCloud.myhome.de’,
  • ‘overwriteprotocol’ => ‘https’,
  • ‘dbname’ => ‘nextcloud’,
  • ‘dbhost’ => ‘localhost:/tmp/sockets/mysql.sock’,
  • ‘dbport’ => ‘’,
  • ‘dbtableprefix’ => ‘oc_’,
  • ‘mysql.utf8mb4’ => true,
  • ‘dbuser’ => ‘nextcloud’,
  • ‘dbpassword’ => ‘HjfSQwwJsOrPgcW_r912yZCMPc34uwcxxSrXy_w4G3iie3vKqj6v7JVZLl-0T4Wh’,
  • ‘installed’ => true,
  • ‘maintenance’ => false,
  • );

Previously, I had already installed NextCloud under the Univention Corporate Server in a virtual machine. Also in this configuration I was able to access NextCloud via the Microsoft IIS server as a reverse proxy. If I opened the local IP address of the virtual server, then I could successfully start Collabora, but if I switched to HTTPS, the connection failed with exactly the same error message.

I suspect that Collabora does not recognize the reverse proxy configuration as opposed to the NextCloud system itself, and therefore loses the connection when trying to launch Collabora. I would think that there must be other options in config.php to communicate reverse proxy configuration to the Collabora system. Unfortunately, I just haven’t found much usable material on the subject now. The best information still seemed to me to be this (I had to do OCR so maybe some mistakes are in the text):

  • “richdocuments”: {
  •   "disable_certificate_verification": "yes", "enabled": "yes",
    
  •   "installed_version": "4.0.4",
    
  •   "types": "filesystem,dav,prevent_group_restricĂźion", "wopi_url": 
    
  •   "htpps:\/\/	\/apps\/richdocumentscode\/proxy.php?req=
    
  • },

Does anyone have any idea how I can convince Collabora that it is behind a reverse proxy? Or do I have a completely different problem that I don’t understand at all at the moment?

:slight_smile: Hannes