# Nextcloud Office / built-in Collabora CODE – WebSocket connection failure

**URL:** <https://help.nextcloud.com/t/nextcloud-office-built-in-collabora-code-websocket-connection-failure/252175>\
**Category:** ℹ️ Support\
**Tags:** office, collabora-built-in\
**Created:** [November 15, 2026, 6:45am UTC](https://help.nextcloud.com/t/nextcloud-office-built-in-collabora-code-websocket-connection-failure/252175 "2026-11-15T06:45:49Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![LogicalUnit](https://help.nextcloud.com/letter_avatar/logicalunit/32/6_22734026db12803ebb3e059622ac3534.png) [@LogicalUnit](https://help.nextcloud.com/u/LogicalUnit)\
**Post date:** [November 15, 2026, 6:45am UTC](https://help.nextcloud.com/t/nextcloud-office-built-in-collabora-code-websocket-connection-failure/252175/1 "2026-11-15T06:45:49Z")

</div>

> ****
>
> I’m having trouble getting the built-in Collabora CODE server working with my Nextcloud installation. When I try to open a `.docx` document, I receive this error:
> 
> > Failed to establish socket connection or socket connection closed unexpectedly. The reverse proxy might be misconfigured.
> 
> **My setup**
> 
> - Nextcloud hosted in a TurnKey Linux (Debian) LXC container.
> 
> - Container IP: `192.168.1.122`.
> 
> - Public hostname: `nextcloud.logicalunit.net`.
> 
> - Apache handles HTTPS and serves Nextcloud.
> 
> - Using the built-in Nextcloud Office CODE app (`richdocumentscode`), version 26.04.5.2.
> 
> - CODE’s `coolwsd` listens locally on `127.0.0.1:9983`.
> 
> **What I’ve confirmed and tried**
> 
> - `curl http://127.0.0.1:9983/hosting/capabilities` returns HTTP 200 with valid JSON.
> 
> - `/hosting/discovery` also returns valid XML, and confirms that `.docx` files are supported.
> 
> - The discovery XML advertises browser endpoints through Nextcloud’s own `apps/richdocumentscode/proxy.php` route.
> 
> - Enabled Apache modules `proxy`, `proxy_http` and `proxy_wstunnel`.
> 
> - Restarted Apache and confirmed these modules are loaded.
> 
> - The Apache configuration currently has a basic HTTPS virtual host serving `/var/www/nextcloud/`, but no specific Collabora reverse-proxy rules.
> 
> **What I’m trying to establish**
> 
> Is the failure likely to be caused by Apache’s handling of WebSocket connections, or is there something else that needs configuring when using the built-in CODE app?
> 
> In particular, should the Apache virtual host contain additional reverse-proxy directives for this setup, or should the built-in `richdocumentscode` proxy handle all of that?
> 
> I’d appreciate any suggestions, particularly from anyone running the built-in CODE app behind Apache on TurnKey Linux or a similar Debian setup.
> 
> Thanks!

---

<div class="post-metadata">

**Author:** ![LogicalUnit](https://help.nextcloud.com/letter_avatar/logicalunit/32/6_22734026db12803ebb3e059622ac3534.png) [@LogicalUnit](https://help.nextcloud.com/u/LogicalUnit)\
**Post date:** [November 15, 2026, 7:14am UTC](https://help.nextcloud.com/t/nextcloud-office-built-in-collabora-code-websocket-connection-failure/252175/2 "2026-11-15T07:14:34Z")

</div>

Solved it: had to disable the evasive apache mod which thought I was dos’ing the server:

a2dismod evasive

systemctl reload apache2
