Try the fastest and simplest way to install ONLYOFFICE

Apache Reverse Proxy; Connector wont load

IIS, Apache

Apache Reverse Proxy; Connector wont load

Postby stansmith » Thu Mar 16, 2017 7:11 pm

I'm having trouble with getting NC to load the connector. My setup is: DocumentServer -->Apache Reverse Proxy (Handles HTTPS certs as well) --> Outside world. When going to https://onlyoffice.mydomain.com the page loads and says everything is well and good.

Now when putting that direct address into NC, the connector never loads, doesn't give any error message or anything. It shows up with a blank white page. One other thing to note, when I go to NC on the internal IP address and then put the DocumentServer internal IP address into the NC connector admin page, everything loads and works 100% as it should. That makes me believe it is something to do with my reverse proxy setup. Here is that code for my virtual host in Apache:

Code: Select all
<IfModule mod_ssl.c>
    <VirtualHost *:80>
        ServerName onlyoffice.mydomain.com
        ServerAdmin myemail@mydomaim.com
        RewriteEngine on
        RewriteCond %{SERVER_NAME} =onlyoffice.mydomain.com
        RewriteRule ^ https://%{SERVER_NAME}%{REQUEST_URI} [END,QSA,R=permanent]
    </VirtualHost>
    <VirtualHost *:443>
        ServerName onlyoffice.mydomain.com
        ServerAdmin myemail@mydomaim.com
        <proxy *>
        AddDefaultCharset off
        Order Allow,Deny
        Allow from all
        </proxy>
        ProxyRequests     Off
        ProxyPreserveHost On
        <location />
        RequestHeader unset Accept-Encoding
        ProxyPass http://192.168.0.22:78/
        ProxyPassReverse http://192.168.0.22:78/
        Order allow,deny
        Allow from All
        </location>
        ProxyPass "/websocket" "wss://192.168.0.22:78/websocket"
        ProxyPassReverse "/websocket" "wss://192.168.0.22:78/websocket"
        SSLCertificateFile /usr/local/etc/letsencrypt/live/onlyoffice.mydomain.com/fullchain.pem
        SSLCertificateKeyFile /usr/local/etc/letsencrypt/live/onlyoffice.mydomain.com/privkey.pem
    </VirtualHost>
    </IfModule>


The Document server is only accessible directly from an internal IP. All external websites for my services are served access through an apache webserver. This keeps flow of traffic to only one server and IP address. Nginx on the document server is not accessible or serving up the domain for onlyoffice-document server.
stansmith
 
Posts: 4
Joined: Thu Mar 16, 2017 2:52 pm

Re: Apache Reverse Proxy; Connector wont load

Postby Maxim » Fri Mar 17, 2017 7:09 am

Hello stansmith!
Using custom port doesn't support by OnlyOffice, 80 port only. I suppose there is a problem.
As an example you should take a look how as it is realized in nginx reverse proxy.
In nginx config we have to set:
Code: Select all
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection $proxy_connection;
proxy_set_header X-Forwarded-Host $the_host;
proxy_set_header X-Forwarded-Proto $the_scheme;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;


Installing and configuring nginx
For IIS
NC - NextCloud?
Maxim
 
Posts: 918
Joined: Tue Oct 11, 2016 2:34 pm

Re: Apache Reverse Proxy; Connector wont load

Postby stansmith » Fri Mar 17, 2017 1:12 pm

Correct, NC=Nextcloud. I am not using Apache for anything other than a reverse proxy. Nginx is used on the document server. This way the document server will run with all defaults as comes installed and Apache only handles the forwarding and routing to the domain name. Since I am able to load https://onlyoffice.mydomain.com and the site loads along with other tests I've done using only the domain. It makes me think that there is a setting in my reverse proxy setup that I don't have in the configuration. Something that needs to be set to help route traffic through the reverse proxy. I conclude this because when I take out the Apache Reverse proxy and us the setup on my internal IP addresses only, everything loads and works as expected.
stansmith
 
Posts: 4
Joined: Thu Mar 16, 2017 2:52 pm

Re: Apache Reverse Proxy; Connector wont load

Postby stansmith » Fri Mar 17, 2017 9:39 pm

**edited** Redundent
Last edited by stansmith on Mon Mar 20, 2017 1:01 pm, edited 1 time in total.
stansmith
 
Posts: 4
Joined: Thu Mar 16, 2017 2:52 pm

Re: Apache Reverse Proxy; Connector wont load

Postby Maxim » Mon Mar 20, 2017 7:53 am

Hello stansmith!
It must be an issue with the reverse proxy Apache config not having a handle or some parameter set to forward information through NC (Nextcloud) connector.

Yes, I agree with you here.
Maxim
 
Posts: 918
Joined: Tue Oct 11, 2016 2:34 pm

Re: Apache Reverse Proxy; Connector wont load

Postby stansmith » Mon Mar 20, 2017 1:01 pm

Are you familiar with Apache and setting a reverse proxy config to help troubleshoot this?
stansmith
 
Posts: 4
Joined: Thu Mar 16, 2017 2:52 pm

Re: Apache Reverse Proxy; Connector wont load

Postby Maxim » Tue Mar 21, 2017 8:14 am

Hello!
No, i'm not
Maxim
 
Posts: 918
Joined: Tue Oct 11, 2016 2:34 pm


Return to Web server configuration

Who is online

Users browsing this forum: No registered users and 1 guest