Collabora with apache proxy

NethServer Version: 7.6.1810
Module: Collabora 3.3.6 , Nextcloud 16.01

Hi, i’m try to use collabora but i run in to an error.
I installed nethserver in a VM, then a installed nextcloud and finally collabora.
N.B. I need to use an Apache proxy because i can’t export the nethserver directly and also because we have other services, so i’ve generated a certificate with let’s encrypt in this Apache proxy.

The problem is that when i try to edit a file the result is this error in network inspector:

bundle.js:41 WebSocket connection to 'wss://collaboratest.qubiarch.cloud/lool/https%3A%2F%2F192.168.20.8%2Fnextcloud%2Findex.php%2Fapps%2Frichdocuments%2Fwopi%2Ffiles%2F153_oc4wmn37sjul%3Faccess_token%3DtNlIO1HLphKPOjoJr54qfyyM3Hq3Bqbx%26access_token_ttl%3D0%26permission%3Dedit/ws?WOPISrc=https%3A%2F%2F192.168.20.8%2Fnextcloud%2Findex.php%2Fapps%2Frichdocuments%2Fwopi%2Ffiles%2F153_oc4wmn37sjul&compat=/ws' failed: Error during WebSocket handshake: Unexpected response code: 404
connect @ bundle.js:41
loadDocument @ bundle.js:42
_activate @ bundle.js:42
_onGotFocus @ bundle.js:43
handler @ bundle.js:49
focus @ bundle.js:47
focus @ bundle.js:42
_activate @ bundle.js:42
_onSocketClose @ bundle.js:41

this is the certificate in the apache proxy

<IfModule mod_ssl.c>
<VirtualHost *:443>
        ServerAdmin #################à
        ServerName  collaboratest.#####.cloud
        ServerAlias collaboratest.#####.cloud
        #DocumentRoot /var/www
        SSLCertificateFile /etc/letsencrypt/live/collaboratest.#####.cloud/fullchain.pem
        SSLCertificateKeyFile /etc/letsencrypt/live/collaboratest.#####.cloud/privkey.pem
        Include /etc/letsencrypt/options-ssl-apache.conf
        ProxyPreserveHost On                                                                                                                                                                    
        ProxyRequests On                                                                                                                                                                        
        LogLevel warn                                                                                                                                                                                                                                                          
        SSLProxyEngine on                                                                                                                                                                                                                                                      
        SSLProxyVerify none                                                                                                                                                                                                                                                    
        SSLProxyCheckPeerCN off                                                                                                                                                                                                                                                
        SSLProxyCheckPeerName off                                                                                                                                                                                                                                              
        SSLProxyCheckPeerExpire off                                                                                                                                                                                                                                            
#        <Proxy *>                                                                                                                                                                                                                                                             
#                Order deny,allow                                                                                                                                                                                                                                              
#                Allow from all                                                                                                                                                                                                                                                
#        </Proxy>                                                                                                                                                                                                                                                              
        ProxyPass / https://collaboratest.#####.cloud/                                                                                                                                                                                                                      
        ProxyPassReverse / https://collaboratest.#####.cloud/                                                                                                                                                                                                               
        CustomLog /var/log/apache2/collaboratest.#####.cloud combined                                                                                                                                                                                                       
</VirtualHost>                                                                                                                                                                                                                                                                 
</IfModule>

this is the zz_collabora.conf

<VirtualHost *:443>
  ServerName collaboratest.#####.cloud
  SSLEngine on
  # Encoded slashes need to be allowed
  AllowEncodedSlashes NoDecode
  # keep the host
  ProxyPreserveHost On
  # static html, js, images, etc. served from loolwsd
  # loleaflet is the client part of LibreOffice Online
  ProxyPass           /loleaflet http://127.0.0.1:9980/loleaflet retry=0
  ProxyPassReverse    /loleaflet http://127.0.0.1:9980/loleaflet
  # WOPI discovery URL
  ProxyPass           /hosting/discovery http://127.0.0.1:9980/hosting/discovery retry=0
  ProxyPassReverse    /hosting/discovery http://127.0.0.1:9980/hosting/discovery
  # Main websocket
  ProxyPassMatch "/lool/(.*)/ws$" ws://127.0.0.1:9980/lool/$1/ws nocanon
  # Admin Console websocket
  ProxyPass   /lool/adminws ws://127.0.0.1:9980/lool/adminws
  # Download as, Fullscreen presentation and Image upload operations
  ProxyPass           /lool http://127.0.0.1:9980/lool
  ProxyPassReverse    /lool http://127.0.0.1:9980/lool
  # Endpoint with information about availability of various features
  ProxyPass           /hosting/capabilities http://127.0.0.1:9980/hosting/capabilities retry=0
  ProxyPassReverse    /hosting/capabilities http://127.0.0.1:9980/hosting/capabilities
</VirtualHost>

and this is the loolwsd.conf

  # Encoded slashes need to be allowed
  AllowEncodedSlashes NoDecode

  # keep the host
  ProxyPreserveHost On

  # static html, js, images, etc. served from loolwsd
  # loleaflet is the client part of LibreOffice Online
  ProxyPass           /loleaflet http://127.0.0.1:9980/loleaflet retry=0
  ProxyPassReverse    /loleaflet http://127.0.0.1:9980/loleaflet

  # WOPI discovery URL
  ProxyPass           /hosting/discovery http://127.0.0.1:9980/hosting/discovery retry=0
  ProxyPassReverse    /hosting/discovery http://127.0.0.1:9980/hosting/discovery

  # Capabilities
  ProxyPass           /hosting/capabilities http://127.0.0.1:9980/hosting/capabilities retry=0
  ProxyPassReverse    /hosting/capabilities http://127.0.0.1:9980/hosting/capabilities

  # Main websocket
  ProxyPassMatch "/lool/(.*)/ws$" ws://127.0.0.1:9980/lool/$1/ws nocanon

  # Admin Console websocket
  ProxyPass   /lool/adminws ws://127.0.0.1:9980/lool/adminws

  # Download as, Fullscreen presentation and Image upload operations
  ProxyPass           /lool http://127.0.0.1:9980/lool
  ProxyPassReverse    /lool http://127.0.0.1:9980/lool

Any suggestions?
thanks

It’s not so easy, but it should work.

Take a look to the upstream documentation: https://www.collaboraoffice.com/code/apache-reverse-proxy/

there is a way in nethserver to make collabora listen on port 9980 in all interfaces? in that case i can manage all in our apache proxy