Websocket behind proxy

We are having a problem with the updated websocket implementation, our reverse proxy is oracle HTTP server (essentially apache). We are using a virtual path from https - our document server is running as a docker container.

The error we are getting is WebSocket socket.io.min.js:6 WebSocket connection to ‘wss://domain/onlyoffice/8.0.1-31/doc/1502661057/c/?WOPISrc=1502661057&EIO=4&transport=websocket’ failed:

Configuration is below:

Define VPATH /onlyoffice
Define DS_ADDRESS ip.address.here

<Location ${VPATH}>
Require all granted
SetEnvIf Host “^(.)$” THE_HOST=$1
RequestHeader setifempty X-Forwarded-Proto https
RequestHeader setifempty X-Forwarded-Host %{THE_HOST}e
RequestHeader edit X-Forwarded-Host (.
) $1${VPATH}
ProxyAddHeaders Off

RewriteEngine on
RewriteCond %{HTTP:Upgrade} websocket [NC]
RewriteCond %{HTTP:Connection} upgrade [NC]
RewriteRule ^${VPATH}/?(.*) “ws://${DS_ADDRESS}/$1” [P,L]
ProxyPass ${VPATH} “http://${DS_ADDRESS}”
ProxyPassReverse ${VPATH} “http://${DS_ADDRESS}”

Any ideas what could be the problem here (we have had the issue for quite some time so have not upgraded our environment due to this issue so are running 7.2.1 in production).

Thanks,

Kristen

Hello @kritta

Please take a look at the sample configs for various proxy services that we provide:

Hi Constantine,

We are using the Apache configuration from this page = https://github.com/ONLYOFFICE/document-server-proxy/blob/master/apache/proxy-to-virtual-path.conf

But still the error remains with the latest docker container on the backend:

socket.io.min.js:6 WebSocket connection to ‘wss://domain.com/onlyOffice/8.0.1-31/doc/-1828584305/c/?WOPISrc=-1828584305&EIO=4&transport=websocket’ failed:

Inside the docker container we have an error as well:

==> /var/log/onlyoffice/documentserver/nginx.error.log <==
2024/03/19 04:55:34 [error] 7814#7814: *116 open() “/var/www/onlyoffice/documentserver/web-apps/vendor/socketio/socket.io.min.js.map” failed (2: No such file or directory), client: 10.3.0.40, server: , request: “GET /8.0.1-31/web-apps/vendor/socketio/socket.io.min.js.map HTTP/1.1”, host: “HOSTNAME”

Not sure what is going wrong here I’m sure it is a small piece of configuration not quite right…

Thanks,

Kristen

Please take a look at this thread for more information on websockets:


In general, are you able to open and edit documents with this?