OnlyOffice editor iframe shows HTML instead of document

Any help or guidance will be greatly appreciated.

ONLYOFFICE Docs (Document Server) is integrated with my self‑hosted Nextcloud instance. Though some documents do not open correctly in the web editor.

Issue

  • When I open certain documents from Nextcloud using ONLYOFFICE, the editor iframe does not display the document content.
  • Instead, an HTML page is rendered inside the iframe. Cloudflare Access was previously involved but has since been removed; Cloudflare is now DNS‑only and the HTML‑in‑iframe issue persists.
  • The same files open correctly in ONLYOFFICE desktop applications and in another web editor (Nextcloud Office/Collabora).

Environment details

  • Document Server version
    • ONLYOFFICE Docs (Document Server) based on the onlyoffice/documentserver Docker image.
    • Version information inside the container shows:
      • default.json: "version": 3
      • documentserver-example/default.json: "version": "1.14.1"
    • If a more precise version string is needed, I can provide the value reported by the healthcheck endpoint.
  • Type of installation of the Document Server
    • Docker container named OnlyOfficeDocumentServer running on Unraid, created via the Unraid Docker template for onlyoffice/documentserver.​​
  • OS
    • Host: Unraid OS (Linux‑based, version available on request).
    • Containers: standard Docker images for Nextcloud and ONLYOFFICE Docs.
  • Browser version
    • Issue reproduced in multiple desktop browsers (for example, recent versions of Firefox and Chrome on Windows); exact versions can be provided if needed.
  • Additional information
    • Nextcloud runs in a separate Docker container on the same Unraid host, using the official ONLYOFFICE integration app.
    • Some data is provided to Nextcloud via the External Storage connector (local/network drives mounted on the server).
    • Cloudflare is currently used only for DNS (no proxy, no Access, no Tunnel).

Symptoms and logs

  • Earlier in troubleshooting, Nextcloud’s ONLYOFFICE app logged errors such as:
    Error occurred in the document service: Invalid token when opening the problematic documents.​
  • I then reset and aligned the JWT secret in the Document Server configuration and in the Nextcloud ONLYOFFICE settings, and restarted the OnlyOfficeDocumentServer container.
  • After that change, opening those same documents no longer produces new ONLYOFFICE entries in Nextcloud’s admin logging (no new “Invalid token” messages); yet some of them still render an HTML page in the editor iframe instead of the document.
  • Other documents open and save normally in the web editor.
  • The problematic files do open correctly in ONLYOFFICE desktop apps and in Nextcloud Office/Collabora.​

Steps already taken

  1. JWT / secret alignment
  • Updated the shared JWT secret used by ONLYOFFICE Docs and the Nextcloud ONLYOFFICE integration so they match, and restarted the Document Server container.
  • Result: the previous Invalid token errors no longer appear when opening the problematic documents.
  1. Network / Cloudflare simplification
  • Removed Cloudflare Access/Tunnel; traffic between Nextcloud and ONLYOFFICE Docs is now direct on the LAN.
  • Cloudflare now acts solely as DNS, but the HTML‑in‑iframe issue remains.​
  1. Functional checks
  • ONLYOFFICE desktop applications can open and edit the problematic documents without issues.
  • Nextcloud Office/Collabora can also open and edit those same documents.
  • The behaviour is document‑specific: some files consistently show HTML in the web editor iframe, others always open correctly.​
  • cache cleared and used different browsers with resolution.

Given this setup:

  • What further configuration checks should I perform in Document Server and/or the Nextcloud ONLYOFFICE connector (URL settings, expectations about response type, interaction with external storage)?
  • Are there known cases where certain documents cause ONLYOFFICE Docs (Docker onlyoffice/documentserver on Unraid) to return an HTML page inside the editor iframe, even when JWT/token validation no longer appears to be failing and the same files work in the ONLYOFFICE desktop apps?
  • any help is greatly appreciated.

Hello @pgonc

Considering all provided information, please try downloading problematic files to your PC and then re-upload them back to Nextcloud with new names. Most certainly, initial issue with Cloudflare made Document Server download HTMLs instead of actual files to the cache and now opening a problematic file brings cached version of it. Re-uploading will create new document keys for the files and they should open normally.

Let me know if it works for you.