Restore Collaboras WebSocket Connection Through the Proxy

When Collabora Online reports that a socket connection closed unexpectedly, first check whether the browser’s WebSocket request reaches coolwsd through the reverse proxy. Match the proxy route to the Collabora version, preserve the WebSocket upgrade and URL path, then test one document while watching the browser’s Network panel and server logs. If the problem began after a CODE 26.04 upgrade behind Apache, check the Apache ProxyPass rules first: Collabora’s 26.04 release notes call out a change for the compact WebSocket URL.

A WebSocket is the long-lived, two-way connection Collabora uses between the browser and its server while a document is open. A reverse proxy is the service that accepts the public request and forwards it to Collabora. The error message points to that connection, but it does not prove that the proxy is the cause; a rejected WOPI host, incorrect public URL, TLS mismatch, or a wrong backend can also stop the session.

Illustrative document editor error dialog stating that the socket connection closed unexpectedly
The dialog shows the socket-closed message that starts this troubleshooting check.

Before changing anything, identify your route

Write down the Collabora version or image tag, proxy software, public Collabora hostname, and whether TLS ends at the proxy or at Collabora. Check the service name and current image without changing the deployment:

docker compose ps collabora
docker compose images collabora

Replace collabora with the service name in your Compose file. For a non-Compose container, use docker ps and docker inspect to identify the container and image. Do not assume that the latest tag still points to the same version you tested last week.

1. See where the WebSocket handshake stops

In the browser, open Developer Tools, select Network, filter for WS or WebSocket, and retry opening one document. The request URL should use wss:// when the public page is HTTPS. Select the failed request and note its status, URL path, and response headers. A successful handshake normally returns 101 Switching Protocols and remains open while the document session is active.

Illustrative browser Network panel filtered to WebSocket requests with a failed request returning status 400
Use the WebSocket request’s status and path to locate the failing hop; this panel is an illustrative example.
  • No WebSocket request appears: check the integration app’s Collabora URL, browser console, DNS, and any redirect or mixed-content error before editing server rules.
  • The request returns 400 or 404: compare the requested path with the route your proxy forwards and the route supported by the installed Collabora version. A 400 in coolwsd that says “Invalid or unknown request” can mean the request reached Collabora with a path it does not accept.
  • The request returns 502 or 504: check whether the proxy can reach the configured Collabora upstream, and whether the address and port point to the correct container or host.
  • The request returns 101, then closes later: inspect proxy, load-balancer, firewall, and client-network idle timeouts. A WebSocket is long-lived, so an intermediary that closes idle connections too soon can interrupt an otherwise successful opening.

2. Compare the proxy rule with your Collabora version

Use Collabora’s current reverse-proxy settings for the proxy software and version you run. Check that the WebSocket route is handled as a WebSocket, that the proxy forwards the upgrade headers, and that it preserves the path and encoded query string rather than redirecting or rewriting them. The proxy must also send the public host and scheme consistently with Collabora’s configured external server name and TLS-termination settings.

For Nginx, review the WebSocket-specific location and its HTTP/1.1, Upgrade, and Connection forwarding directives in Collabora’s current example. For Apache, compare the ProxyPass rule and ordering with the current example; do not paste an old /cool/…/ws match unchanged without checking what your installed release now requests.

This version check matters for CODE 26.04. Collabora’s release notes, published June 8, 2026, describe a more compact WebSocket URL and say Apache reverse-proxy users need to adjust ProxyPass for it. Later 26.04 work added fallback behavior for legacy URLs, so an older rule may still work on some builds; Collabora’s resolved 26.04 WebSocket report documents that follow-up. The fallback is not a substitute for matching the current proxy configuration to the installed version. Read the CODE 26.04 release notes and updated SDK example together.

Illustrative redacted coolwsd log pattern showing an invalid request for the compact WebSocket path
This redacted example shows the kind of invalid-request path to compare with the route your proxy forwards; it is not a live log capture.

3. Capture one failure and make one targeted change

Start a short log stream before retrying the document. Docker’s --since option limits the initial output, while --follow streams new lines; see the Docker Compose logs reference.

docker compose logs --since=2m --follow collabora

Record the time of the test and look for the same request in the Collabora and proxy logs. If the browser requests a path that the proxy routes to the wrong backend, update only that WebSocket route using Collabora’s version-matched example. If the request reaches Collabora but the host, origin, or scheme is rejected, compare the public hostname and port with the configured server name and forwarded headers. If the log instead shows a WOPI host rejection or a failed file-information request, check the integration server’s allowed host and its reachability from the Collabora container; that is a separate step from the browser WebSocket handshake.

Reload the proxy after validating its configuration with that proxy’s own syntax-check command. Avoid changing TLS termination, host allow-lists, and URL rewrites at the same time: changing one cause per test makes the next result interpretable. Do not turn off TLS verification or allow every WOPI host as a shortcut.

4. Verify the fix from the browser to the document

Retry the same document. In Developer Tools, confirm that its WebSocket request returns 101 Switching Protocols and stays open. Confirm that the document finishes loading, remains connected, and accepts a small edit that saves successfully. A healthy connection status alone is not enough if WOPI file access or saving still fails.

Illustrative browser Network panel showing a WebSocket request with status 101 Switching Protocols and connected state
A 101 response and an open connection are the browser-side signs that the WebSocket handshake now succeeds.

If the handshake still fails, compare the browser request path, proxy access/error line, and the matching coolwsd log entry at the same timestamp. This three-point comparison shows whether the browser, proxy, Collabora route, or WOPI host is the next place to investigate. When asking for help, redact access tokens, document identifiers, usernames, and private hostnames from both browser details and logs.

Leave a Comment

Restore Collaboras WebSocket Connection Through the Proxy

Restore Collaboras WebSocket Connection Through the Proxy

Trace a failed socket handshake from browser to coolwsd, then match the reverse-proxy route to your Collabora version, including the CODE 26.04 Apache change.

Fix WOPI Proof Errors by Checking Keys, Discovery, and URLs

Fix WOPI Proof Errors by Checking Keys, Discovery, and URLs

Trace Collabora WOPI proof failures to mismatched keys, stale discovery data, clock drift, or proxy URL changes—without weakening validation.

Fix a Misrendered Collabora Online Font Size Dropdown

Fix a Misrendered Collabora Online Font Size Dropdown

Reset browser zoom, test a clean session, and identify when a malformed size menu needs a Collabora server update.

Connect Nextcloud to a Self-Hosted Collabora CODE Container

Connect Nextcloud to a Self-Hosted Collabora CODE Container

Deploy Collabora CODE with Docker, connect it securely to Nextcloud Office, and verify document editing with practical WOPI and proxy checks.

Trace Collabora Connection Failures with coolwsd Logs

Trace Collabora Connection Failures with coolwsd Logs

Temporarily raise coolwsd to debug, capture one failed open, and use the log sequence to separate WebSocket, WOPI, proxy, and container issues.

Set a Secure Password for the Collabora Admin Console

Set a Secure Password for the Collabora Admin Console

Configure the Collabora Online admin login for Docker or Linux, restart the right service, and verify the new password without exposing it.

Diagnose High CPU from Collabora’s coolwsd or loolwsd

Diagnose High CPU from Collabora’s coolwsd or loolwsd

Find out whether CPU load comes from active documents, idle worker processes, or server capacity before changing Collabora settings or restarting the service.

Raise the CODE Container’s Memory Cap Without Guessing

Raise the CODE Container’s Memory Cap Without Guessing

Check whether Docker is capping Collabora CODE, raise the Compose memory limit safely, and confirm the running container received the new cap.

Customize Collabora CODE Toolbars Without Editing Source

Customize Collabora CODE Toolbars Without Editing Source

Simplify Collabora CODE with Compact or Tabbed mode and WOPI PostMessage controls to hide selected buttons, commands, and tabs safely.

Run Collabora CODE Behind Nginx with TLS Termination

Run Collabora CODE Behind Nginx with TLS Termination

Put Nginx in charge of HTTPS for a Collabora CODE container, forward editing WebSockets correctly, and verify the public endpoint without exposing port 9980.