OnlyOffice running on a different server throws error "Download failed"

Hi there,

I have nextcould running in an LXC container on my proxmox using the AIO docker image. I also have another LXC container with onlyoffice also running in docker. I connected my nextcloud instance to the onlyoffice instance and when I now open a office file in the nextcloud installation, it opens it in the onlyoffice instance. At least it tries to. This is the error I get:

When I look in the browser console, I see, that the system tries to load a file from a HTTP endpoint, although my onlyoffice instance is HTTPS.
And this results in an error:

sdk-all-min.js:511 Mixed Content: The page at 'https://cloud.domain.com/' was loaded over HTTPS, but requested an insecure XMLHttpRequest endpoint 'http://office.domain.com/cache/files/data/840157237/Editor.bin/Editor.bin?md5=nxOelhHBGlPZ8Xp4W_EoqQ&expires=1720012221&WOPISrc=840157237&filename=Editor.bin'. This request has been blocked; the content must be served over HTTPS.

I have no idea, why this is loaded via HTTP, since the URL for the onlyoffice server is set to https://office.domain.com.

I think this is the main issue, but I don’t know how to fix it.

I would really appreciate if someone can give me a hint on this error. Thanks!

The same problem was discussed on the Internet. You need to rewrite sdk-all-min.js and everything will be fine

I solved it via a traefik middleware, thanks!

http:
  middlewares:
    redirect_http2https_header:
      headers:
        contentSecurityPolicy: "upgrade-insecure-requests"
http:
  routers:
    office:
      service: onlyoffice
      entryPoints:
        - "https"
      rule: "Host(`office.domain.io`)"
      middlewares:
        - redirect_http2https_header

  services:
    onlyoffice:
      loadBalancer:
        servers:
          - url: "http://192.168.1.1"