I seem to have found the problem. Looking at the docker log, I saw these errors:
ERR Unknown resource: /lool//ws/lool/https%3A%2F%2Fcloud.mydomain.com%2Fapps%2Frichdocuments%2Fwopi%2Ffiles%2F37_ocae6u5q3hhs%3Faccess_token%3Duc6XUKZirEw0LrQcKhVm7MQkR612MNgD%26access_token_ttl%3D0%26permission%3Dedit/ws| wsd/LOOLWSD.cpp:1223
So, I trawled through the config files, to see if anything looked off. I found this in /etc/apache2/sites-available/office.mydomain.com.conf:
Main websocket
ProxyPassMatch “/lool/(.*)/ws$” wss://127.0.0.1:9980/lool//ws nocanon
It seems from looking at other people’s configs, this is missing $1 between the slashes.
Main websocket
ProxyPassMatch “/lool/(.*)/ws$” wss://127.0.0.1:9980/lool/$1/ws nocanon
Having made that change, it works fine now. I’m puzzled how my setup yielded this syntax error, and yet for others it must be working?