Onlyoffice Proxy Issues on a second server

Hi,

I have Nextcloud running via Apache on a server visible to WAN (cloud.XXX.com). Let’s call this server MIDGAR

I have installed OnlyOffice with Nginx on a second server on the same LAN, but clearly not visible to WAN. Let’s call this server MIDEEL.

I have been successful in using ProxyPass on Apache on MIDGAR to send traffic from office.XXX.com to MIDEEL with SSL authentication on MIDGAR using Let’s Encrypt.

office.XXX.com.conf on MIDGAR:

<VirtualHost *:80>

        ServerName office.XXX.com
        RewriteEngine on
        RewriteCond %{SERVER_NAME} =office.XXX.com
        RewriteRule ^ https://%{SERVER_NAME}%{REQUEST_URI} [END,QSA,R=permanent]

</VirtualHost>

<VirtualHost *:443>

        ServerName office.XXX.com
        ServerAlias office.XXX.com
        ProxyPass / http://192.168.200.200/
        ProxyPassReverse / http://192.168.200.200/

        SSLEngine on
        SSLProxyVerify none
        SSLProxyCheckPeerCN off
        SSLProxyCheckPeerName off
        SSLProxyCheckPeerExpire off

        SSLCertificateFile /etc/letsencrypt/live/office.XXX.com/fullchain.pem
        SSLCertificateKeyFile /etc/letsencrypt/live/office.XXX.com/privkey.pem
        Include /etc/letsencrypt/options-ssl-apache.conf

</VirtualHost>

onlyoffice-documentserver-*.conf on MIDEEL:

include /etc/nginx/includes/onlyoffice-http.conf;
server {
  listen 0.0.0.0:80;
  listen [::]:80 default_server;
  server_name office.XXX.com;
  server_tokens off;

  include /etc/nginx/includes/onlyoffice-documentserver-*.conf;

  location ~ /.well-known/acme-challenge {
        root /var/www/onlyoffice/;
        allow all;
  }
}

Under this situation regular browser requests to office.XXX.com successfully resolve to OnlyOffice on MIDEEL with accepted SSL. However when trying to integrate into Nextcloud I am faced with a 302 error.

Please help!

I don’t know the answer to this question exactly, but why running it on two servers when you can run it on one?

I’ve made a script that you can use so that you won’t get this problem: OnlyOffice is now integrated in the Nextcloud VM!

1 Like

Thanks, I did already see the thread, and in the end that may be the route I will take, but to be honest I would rather run OO on a second physical machine so as not to occupy resources (RAM) on my primary server.

Also, I do know that this method works, there is already one thread where someone has successfully achieved similar, but they were not clear enough about the steps taken to success, which is why I started a new thread.

I have used the OO script created by @enoch85 to install OO on the same machine as my NC instance, but I still think we need to have a reliable tutorial for users who wish to setup OO on a second machine or (vm) on the same network given the increased resource demand that OO represents.

Howdy,

Officially OO requires you setup OO directly with SSL, I note you have it setup utilising port 80 there.

If you go back through the OO docserver setup: https://helpcenter.onlyoffice.com/server/linux/document/switch-to-https.aspx and configure OO with SSL you should be fine.

Thanks @JasonBayton, I’ll test that at a future date, as I have OO now up and running on the same server and have upgraded the RAM on my machine to 16 GB now.

1 Like