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

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!

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

a2dismod evasive

systemctl reload apache2