Error behind an Apache reverse proxy
Error behind an Apache reverse proxy
Hello,
I have setup the community edition via the automated install script (bash opensource-install.sh -md "yourdomain.com"), in a VM, in an internal network (the VM has IP 192.168.1.158).
Now, I want to expose the Onlyoffice portal on the outside, via an Apache reverse proxy, with let`s encrypt setup on the proxy.
I can see the Onlyoffice loading, seems OK, I can login, but I cannot edit a document, as the server timeouts waiting for 192.168.1.158, which, of course, is not accessible from an external address. Moreover, I cannot upload files, I get just a plain "error" message.
I can see that when I share a file, I get an URL like http://192.168.1.158/products/files/doc ... Nbz0_IjEi0
Of course, internally it works.
What am I missing, I spent some time searching over google how to change the base URL.
Thank you in advance for your help!
I have setup the community edition via the automated install script (bash opensource-install.sh -md "yourdomain.com"), in a VM, in an internal network (the VM has IP 192.168.1.158).
Now, I want to expose the Onlyoffice portal on the outside, via an Apache reverse proxy, with let`s encrypt setup on the proxy.
I can see the Onlyoffice loading, seems OK, I can login, but I cannot edit a document, as the server timeouts waiting for 192.168.1.158, which, of course, is not accessible from an external address. Moreover, I cannot upload files, I get just a plain "error" message.
I can see that when I share a file, I get an URL like http://192.168.1.158/products/files/doc ... Nbz0_IjEi0
Of course, internally it works.
What am I missing, I spent some time searching over google how to change the base URL.
Thank you in advance for your help!
Re: Error behind an Apache reverse proxy
Hello Maxim,
Thank you for your time! I followed your advice and I still have the issue.
Here is my reverse proxy config. The server is installed all on the same VM (192.168.1.158), with docker. The following config is on the front facing apache that is a reverse proxy:
I still get errors when trying to edit a file, or upload it via the external URL.
Thank you!
Thank you for your time! I followed your advice and I still have the issue.
Here is my reverse proxy config. The server is installed all on the same VM (192.168.1.158), with docker. The following config is on the front facing apache that is a reverse proxy:
Code: Select all
<IfModule mod_ssl.c>
<VirtualHost *:443>
ServerName intranet.domain.com
ServerAlias intranet.domain.com
SSLEngine on
SSLCipherSuite EECDH+AESGCM:EDH+AESGCM:AES256+EECDH:ECDHE-RSA-AES128-SHA:DHE-RSA-AES128-GCM-SHA256:AES256+EDH:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-RSA-AES128-GCM-S
HA256:DHE-RSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-SHA384:ECDHE-RSA-AES128-SHA256:ECDHE-RSA-AES256-SHA:DHE-RSA-AES256-SHA256:DHE-RSA-AES128-SHA256:DHE-RSA-AES256-SHA:DHE-
RSA-AES128-SHA:ECDHE-RSA-DES-CBC3-SHA:EDH-RSA-DES-CBC3-SHA:AES256-GCM-SHA384:AES128-GCM-SHA256:AES256-SHA256:AES128-SHA256:AES256-SHA:AES128-SHA:DES-CBC3-SHA:HIGH:!aNUL
L:!eNULL:!EXPORT:!DES:!MD5:!PSK:!RC4
SSLProtocol All -SSLv2 -SSLv3
SSLCompression off
SSLHonorCipherOrder on
SetEnvIf Host "^(.*)$" THE_HOST=$1
RequestHeader setifempty X-Forwarded-Proto https
RequestHeader setifempty X-Forwarded-Host %{THE_HOST}e
ProxyAddHeaders Off
ProxyPassMatch (.*)(\/websocket)$ "ws://192.168.1.158/$1$2"
ProxyPass / "http://192.168.1.158/"
ProxyPassReverse / "http://192.168.1.158/"
ErrorLog ${APACHE_LOG_DIR}/intranet.domain.com/error.log
CustomLog ${APACHE_LOG_DIR}/intranet.domain.com/access.log combined
SSLCertificateFile /etc/letsencrypt/live/intranet.domain.com-0001/cert.pem
SSLCertificateKeyFile /etc/letsencrypt/live/intranet.domain.com-0001/privkey.pem
Include /etc/letsencrypt/options-ssl-apache.conf
SSLCertificateChainFile /etc/letsencrypt/live/intranet.domain.com-0001/chain.pem
</VirtualHost>
</IfModule>
Thank you!
Re: Error behind an Apache reverse proxy
Hello alexkara!
You can try to change this part
to
where PROXY_HOST_NAME is your proxy
You can try to change this part
Code: Select all
RequestHeader setifempty X-Forwarded-Proto https RequestHeader setifempty X-Forwarded-Host %{THE_HOST}e
Code: Select all
RequestHeader X-Forwarded-Proto https RequestHeader X-Forwarded-Host PROXY_HOST_NAME
Re: Error behind an Apache reverse proxy
Hello Maxim,
PROXY_HOST_NAME should be the internal DNS name of the proxy (intranet.local), or the external URL (intranet.domain.com)?
Thank you!
PROXY_HOST_NAME should be the internal DNS name of the proxy (intranet.local), or the external URL (intranet.domain.com)?
Thank you!
Re: Error behind an Apache reverse proxy
Hello,
I still did not manage to figure it out.. I set proxy, not working.
In any case, I installed Document Server and Community Server on spare VMs, using the debian repo.
Now I can edit <add key="files.uploader.url" value="products/files/"/> in web.appsettings.config to point to my https address, behind the proxy: <add key="files.uploader.url" value="https://intranet.domain.com/products/files/".
But it is still not working, I get Resource not found and it points to http://192.168.1.158/api/2.0/files......
If I paste that URL to https://intranet.domain.com/api/2.0/file..... I get Resource not found.
Any ideas?
Thank you!
I still did not manage to figure it out.. I set proxy, not working.
In any case, I installed Document Server and Community Server on spare VMs, using the debian repo.
Now I can edit <add key="files.uploader.url" value="products/files/"/> in web.appsettings.config to point to my https address, behind the proxy: <add key="files.uploader.url" value="https://intranet.domain.com/products/files/".
But it is still not working, I get Resource not found and it points to http://192.168.1.158/api/2.0/files......
If I paste that URL to https://intranet.domain.com/api/2.0/file..... I get Resource not found.
Any ideas?
Thank you!
Re: Error behind an Apache reverse proxy
Hello alexkara!
Honostly to say i have no idea unfortunatelyAny ideas?
Re: Error behind an Apache reverse proxy
Hello Maxim,
Thank you for your support. Should I try and post this issue in the gitlab forum?
All the best!
Thank you for your support. Should I try and post this issue in the gitlab forum?
All the best!