Hi,
I’m trying to configure an ONLYOFFICE Docs instance behind a proxy with a virtual path.
Everything worked good and I managed to run the example front page, but I cannot edit any document: there is a 404 error when calling the file api.js
as the virtual path is not correctly set.
The proxy is an Apache HTTP server. I followed the example here:
And I ended up with the following, more or less a copy-paste from the doc:
(...)
Define VPATH /onlyoffice
Define DS_ADDRESS localhost:81
<Location ${VPATH}>
Require all granted
SetEnvIf Host "^(.*)$" THE_HOST=$1
RequestHeader setifempty X-Forwarded-Proto http
RequestHeader setifempty X-Forwarded-Host %{THE_HOST}e
RequestHeader edit X-Forwarded-Host (.*) $1${VPATH}
ProxyAddHeaders Off
</Location>
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}"
(..)
But while pretty much everything is correctly redirected to /onlyoffice
, it is not the case for api.js
.
The called URL is site.tld/web-apps/apps/api/documents/api.js
, which is wrong.
It should be site.tld/onlyoffice/web-apps/apps/api/documents/api.js
.
Any idea on the issue? Thanks in advance for your insights.