Why I always got error message The file is corrupted after I integrated it with nginx & SSL termination

I have configurations owncloud and collabora together in my machine.
I putted reverse proxy NGINX in front of them.
It was working fine when I did it without SSL,
(nginx → owncloud → collabora)
then I wanted to try to implement SSL termination on my nginx and implement cloudflare tunneling to access it from the internet.
so the configuration becomes this.
(cloudflare → nginx → owncloud, cloudflare → nginx → collabora)

Now each time I open my document in owncloud + collabora, I get this error message

I only able to find these logs in the collabora log file.

frk-00023-00023 2025-05-19 00:34:09.051039 +0000 [ forkit ] ERR  Error while copying from /etc/passwd to /opt/cool/systemplate//etc/passwdu4nP2L0dtdPm: Failed to open dest /opt/cool/systemplate//etc/passwdu4nP2L0dtdPm| common/FileUtil.cpp:129
kit-00101-00101 2025-05-19 00:34:09.283609 +0000 [ kit_spare_00d ] ERR  Failed to get the realpath of [/opt/cool/child-roots/1-77fe115e/tmp/sharedpresets/template] (ENOENT: No such file or directory)| common/FileUtil.cpp:284
kit-00101-00101 2025-05-19 00:34:09.283699 +0000 [ kit_spare_00d ] ERR  linkOrCopy: nftw() failed for '/opt/cool/child-roots/1-77fe115e/tmp/sharedpresets/template'| kit/Kit.cpp:594
wsd-00001-00100 2025-05-19 00:34:16.968148 +0000 [ docbroker_005 ] ERR  ToClient-035: jserror Collabora Online not loaded yet. Listen for App_LoadingStatus (Document_Loaded) event before using PostMessage API. Ignoring post message 'welcome-close'.
| wsd/ClientSession.cpp:783

this is the only log I got in owncloud when I tried to open the document

{"reqId":"9GhSxxxxxxxxxxxx","level":1,"time":"2025-05-19T00:37:14+00:00","remoteAddr":"24xx:26xx:7c1:13xx:adxx:2da5:xxxx:xxxx","user":"admin","app":"richdocuments","method":"GET","url":"\/apps\/richdocuments\/documents.php\/index?fileId=5&dir=%2FDocuments","message":"Generating WOPI Token for file 5, version 0."}

it seems the Collabora able to connect with owncloud, but maybe there are some issues on the data transmission. maybe my nginx configuration are the problems?
but I’m able to open the admin page on Collabora without an issue.

Hii @feechanz

this issue typically stems from the NGINX reverse proxy configuration, especially when introducing SSL termination and Cloudflare tunneling.

You’re seeing the “The file is corrupted” error because the document cannot be successfully fetched or opened by Collabora

Checklist of Likely Causes

1. Incorrect Headers or Body Being Stripped or Rewritten

When NGINX is used with SSL termination and Cloudflare, it might not forward:

  • All required headers (like Host, X-Forwarded-For, X-Forwarded-Proto)
  • Request body (in case of buffering/misconfig)

This breaks WOPI or websocket communication.

2. Missing or Incorrect NGINX WebSocket Support

Collabora uses WebSockets. NGINX must be explicitly configured to upgrade WebSocket connections.

3. Broken Paths or Content Rewriting

Cloudflare or NGINX might be rewriting paths or blocking certain MIME types, especially if certain cache/page rules or Rocket Loader are enabled.

Here are sample configuration file and instructions about how to setup reverse proxy with collabora Proxy settings — SDK https://sdk.collaboraonline.com/ documentation

Thanks
Darshan

1 Like

thank you for replying my question!
yes, I did follow the Proxy Settings in collabora documentation.

At least I know that the problem is when Collabora cannot fetch the file.

I will try to adjust my NGINX configurations, especially on the owncloud side.
assuming the collabora nginx configurations already correct because I followed the configurations from this page:
Proxy settings — SDK https://sdk.collaboraonline.com/ documentation

I was confused because there are no specific error message.
Tried to enabled log info level, not really specific clue.

1 Like