Onlyoffice Proxy Issues on a second server


I have Nextcloud running via Apache on a server visible to WAN ( 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 to MIDEEL with SSL authentication on MIDGAR using Let’s Encrypt. on MIDGAR:

<VirtualHost *:80>

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


<VirtualHost *:443>

        ProxyPass /
        ProxyPassReverse /

        SSLEngine on
        SSLProxyVerify none
        SSLProxyCheckPeerCN off
        SSLProxyCheckPeerName off
        SSLProxyCheckPeerExpire off

        SSLCertificateFile /etc/letsencrypt/live/
        SSLCertificateKeyFile /etc/letsencrypt/live/
        Include /etc/letsencrypt/options-ssl-apache.conf


onlyoffice-documentserver-*.conf on MIDEEL:

include /etc/nginx/includes/onlyoffice-http.conf;
server {
  listen [::]:80 default_server;
  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 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.


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: 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