Collabora Online: Unable to open document (connection refuesed)

I’m getting the message “Well, this is embarrassing, we cannot connect to your document. Please try again.”

Docker image debug log:

Generating RSA private key, 2048 bit long modulus
[...]
Signature ok
subject=/C=DE/ST=BW/L=Stuttgart/O=Dummy Authority/CN=localhost
Getting CA Private Key
loolwsd version details: 1.9.8 - 1.9.8
loolforkit version details: 1.9.8 - 1.9.8
wsd-00026-0027 0:00:24.987790 [ client_ws_0001 ] WRN  getNewChild: No available child. Sending spawn request to forkit and failing.| LOOLWSD.cpp:376
wsd-00026-0027 0:00:29.988016 [ client_ws_0001 ] ERR  Failed to get new child. Service Unavailable.| LOOLWSD.cpp:822
wsd-00026-0027 0:00:30.045839 [ client_ws_0001 ] ERR  ClientRequestHandler::handleClientRequest: WebSocketErrorMessageException: error: cmd=socket kind=serviceunavailable| LOOLWSD.cpp:1139
office version details: { "ProductName": "Collabora Office", "ProductVersion": "5.1", "ProductExtension": ".10.12", "BuildId": "653cc4c38dd2c05aecbee156aef460f5a361e579" }
[now opening the document]
wsd-00026-0029 0:02:42.888826 [ client_ws_0002 ] ERR  Error in client request handler: Connection refused| LOOLWSD.cpp:966

Browser debug log:
Request URL:

Request header:

User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:50.0) Gecko/20100101 Firefox/50.0
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
Accept-Language: en-US,en;q=0.5
Accept-Encoding: gzip, deflate, br
Sec-WebSocket-Version: 13
Origin: https://nextcloud.project-insanity.org
Sec-WebSocket-Extensions: permessage-deflate
Sec-WebSocket-Key: ****==
Cookie: nc_sameSiteCookielax=true; nc_sameSiteCookiestrict=true; ****=****; oc_sessionPassphrase=****
DNT: 1
Connection: keep-alive, Upgrade
Pragma: no-cache
Cache-Control: no-cache
Upgrade: websocket

Server response on websocket reqeust:

Content-Length: 0
Date: Wed, 07 Dec 2016 11:37:07 GMT
Sec-WebSocket-Accept: ****=
Server: nginx/1.10.2
Upgrade: websocket

Well in my case, the setup is a bit difficult. I’m using Caddy as a reverse proxy

Internet -> Server A (Caddy) – (proxy pass) --> Server B (Nextcloud + Docker)

Here’s my Caddyfile

        log /var/log/caddy/nextcloud.project-insanity.org_access.log {
                rotate {
                        size 50 # Rotate after 50 MB
                }
        }
        gzip
        tls crux@project-insanity.org
        proxy / http://http-new.pi:9080 {
                proxy_header Host {host}
                proxy_header X-Real-IP {remote}
                proxy_header X-Forwarded-Proto {scheme}
                header_downstream -Server ""
                websocket
        }
}

also tried this one but it doesn’t help neither

        log /var/log/caddy/nextcloud.project-insanity.org_access.log {
                rotate {
                        size 50 # Rotate after 50 MB
                }
        }
        tls crux@project-insanity.org
        proxy / http://http-new.pi:9080 {
                transparent
                websocket
        }
}

Its difficult to debug this further since the connection is ssl encrypted so I don’t know where to use tcpdump …

Does the WOPI discovery URL work?

looks good to me https://nextcloud.project-insanity.org/hosting/discovery