Document loading failed | Failed to load Nextcloud Office

I just installed nextcloud on a proxmox container inside a docker container and Nextcloud Office was working fine. However, I was running on the Unencrypted mode.

Once I configured NC to use my reverse proxy (caddy) under HTTPs I wasn’t able to open any files anymore.

I will say that I cannot access NC locally anymore (SSL protocol error) and I can only access it through my external DNS address

This is the only thing I changed in the config:

'trusted_domains' => 
  array (
    0 => '',
    1 => '',
  'trusted_proxies' => [''],
  'overwrite.cli.url' => '',
  'overwriteprotocol' => 'https',

I imagine the reason why I cannot connect locally is that it’s forcing an HTTPs redirect and there’s no HTTPs server running.

I also did add to the WOPI requests field, but that didn’t do anything.

I was also trying to setup a TURN server to go through the reverse proxy, but I don’t think that’d cause any problems.

I discovered this is only happening over the Reverse Proxy or maybe just HTTPS. It will work no problem if it’s over HTTP locally.