Try the fastest and simplest way to install ONLYOFFICE

Error behind an Apache reverse proxy

Questions/problems on Docker

Error behind an Apache reverse proxy

Postby alexkara » Wed Jun 21, 2017 7:02 am

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!
alexkara
 
Posts: 10
Joined: Wed Jun 21, 2017 6:46 am

Re: Error behind an Apache reverse proxy

Postby Maxim » Tue Jun 27, 2017 10:04 am

Hello alexkara!
You need to add headers. See here and here
Maxim
 
Posts: 1077
Joined: Tue Oct 11, 2016 2:34 pm

Re: Error behind an Apache reverse proxy

Postby alexkara » Wed Jul 05, 2017 2:39 pm

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:

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>


I still get errors when trying to edit a file, or upload it via the external URL.

Thank you!
alexkara
 
Posts: 10
Joined: Wed Jun 21, 2017 6:46 am

Re: Error behind an Apache reverse proxy

Postby Maxim » Thu Jul 06, 2017 9:46 am

Hello alexkara!
You can try to change this part
Code: Select all
RequestHeader setifempty X-Forwarded-Proto https RequestHeader setifempty X-Forwarded-Host %{THE_HOST}e


to
Code: Select all
RequestHeader X-Forwarded-Proto https RequestHeader X-Forwarded-Host PROXY_HOST_NAME

where PROXY_HOST_NAME is your proxy
Maxim
 
Posts: 1077
Joined: Tue Oct 11, 2016 2:34 pm

Re: Error behind an Apache reverse proxy

Postby alexkara » Fri Jul 07, 2017 9:03 am

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!
alexkara
 
Posts: 10
Joined: Wed Jun 21, 2017 6:46 am

Re: Error behind an Apache reverse proxy

Postby alexkara » Thu Jul 13, 2017 3:37 pm

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!
alexkara
 
Posts: 10
Joined: Wed Jun 21, 2017 6:46 am

Re: Error behind an Apache reverse proxy

Postby Maxim » Fri Jul 14, 2017 8:43 am

Hello alexkara!
Any ideas?

Honostly to say i have no idea unfortunately
Maxim
 
Posts: 1077
Joined: Tue Oct 11, 2016 2:34 pm

Re: Error behind an Apache reverse proxy

Postby alexkara » Fri Jul 14, 2017 9:34 am

Hello Maxim,

Thank you for your support. Should I try and post this issue in the gitlab forum?

All the best!
alexkara
 
Posts: 10
Joined: Wed Jun 21, 2017 6:46 am


Return to Docker Version

Who is online

Users browsing this forum: No registered users and 1 guest