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

**URL:** <https://forum.collaboraonline.com/t/why-i-always-got-error-message-the-file-is-corrupted-after-i-integrated-it-with-nginx-ssl-termination/3693>\
**Category:** Installation & Configuration\
**Created:** [May 19, 2025, 12:41am UTC](https://forum.collaboraonline.com/t/why-i-always-got-error-message-the-file-is-corrupted-after-i-integrated-it-with-nginx-ssl-termination/3693 "2025-05-19T00:41:44Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![feechanz](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.collaboraonline.com/feechanz/32/1706_2.png) [@feechanz](https://forum.collaboraonline.com/u/feechanz)\
**Post date:** [May 19, 2025, 12:41am UTC](https://forum.collaboraonline.com/t/why-i-always-got-error-message-the-file-is-corrupted-after-i-integrated-it-with-nginx-ssl-termination/3693/1 "2025-05-19T00:41:44Z")

</div>

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

 ![image](https://europe1.discourse-cdn.com/flex013/uploads/collaboraonline/original/2X/a/a86214f52f1b3cb4049375e19e9e7c73032a9e90.png)

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

```auto
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

```auto
{"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.

---

<div class="post-metadata">

**Author:** ![darshan](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.collaboraonline.com/darshan/32/2230_2.png) [@darshan](https://forum.collaboraonline.com/u/darshan)\
**Post date:** [May 20, 2025, 7:09am UTC](https://forum.collaboraonline.com/t/why-i-always-got-error-message-the-file-is-corrupted-after-i-integrated-it-with-nginx-ssl-termination/3693/2 "2025-05-20T07:09:35Z")

</div>

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 [Making sure you're not a bot!](https://sdk.collaboraonline.com/docs/installation/Proxy_settings.html?highlight=nginx)

Thanks  
Darshan

---

<div class="post-metadata">

**Author:** ![feechanz](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.collaboraonline.com/feechanz/32/1706_2.png) [@feechanz](https://forum.collaboraonline.com/u/feechanz)\
**Post date:** [May 21, 2025, 7:54am UTC](https://forum.collaboraonline.com/t/why-i-always-got-error-message-the-file-is-corrupted-after-i-integrated-it-with-nginx-ssl-termination/3693/3 "2025-05-21T07:54:15Z")

</div>

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](https://sdk.collaboraonline.com/docs/installation/Proxy_settings.html?highlight=nginx)

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

---

<div class="post-metadata">

**Author:** ![darshan](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.collaboraonline.com/darshan/32/2230_2.png) [@darshan](https://forum.collaboraonline.com/u/darshan)\
**Post date:** [May 28, 2025, 8:43am UTC](https://forum.collaboraonline.com/t/why-i-always-got-error-message-the-file-is-corrupted-after-i-integrated-it-with-nginx-ssl-termination/3693/4 "2025-05-28T08:43:48Z")

</div>


