Cannot get Collabora working on docker

I have Nextcloud on port 8082 and collabora within the same docker-compose.yml file at port 9980.
I can get access Nextcloud at:
http://docker-node-01:8082/
and it works fine.
However, I can get neither built-in CODE server not the Collabora docker to work over reverse proxy. ( Nextcloud Office app installed)

The URL http://docker-node-01:9980/
says OK as if it’s working.

But the document says Loading indefinitely.
It works internally with url
http://docker-node-01:8082/custom_apps/richdocumentscode/proxy.php?req=
as code server URL,
However when I use Apache reverse proxy and provide the same URL with WAN domain, it doesnt work. My apache config:

my Nextcloud Apache config:

<VirtualHost *:443>

    ServerName cloud.example.com
    ServerAdmin root@example.com

    ErrorLog /var/log/httpd/cloud.example.com_error.log
    CustomLog /var/log/httpd/cloud.example.com_access.log combined

    SSLProxyEngine on
    SSLProxyVerify none 
    SSLProxyCheckPeerCN off
    SSLProxyCheckPeerName off
    SSLProxyCheckPeerExpire off

    ProxyPass / http://docker-node-01:8082/
    ProxyPassReverse / http://docker-node-01:8082/
    ProxyPassReverseCookiePath / /

#    <Location />
#        AllowOverride None
#        Require all granted
#        AddOutputFilterByType INFLATE;SUBSTITUTE;DEFLATE text/html
#        Substitute "s|http://docker-node-01:8082|https://cloud.example.com|nq"
#    </Location>

    <Location /login>
        Require all denied
        Require ip 10.1.0.0/16
        Require ip 10.5.0.0/16
        Require ip 10.6.0.0/16
    </Location>

    # SSL
    SSLEngine on
    SSLProtocol all -SSLv2 -SSLv3
    SSLHonorCipherOrder on

    SSLCipherSuite "EECDH+ECDSA+AESGCM EECDH+aRSA+AESGCM \
                    EECDH+ECDSA+SHA384 EECDH+ECDSA+SHA256 \
                    EECDH+aRSA+SHA384 EECDH+aRSA+SHA256 \
                    EECDH EDH+aRSA \
                    !aNULL !eNULL !LOW !3DES !MD5 !EXP !PSK !SRP !DSS !RC4"

    SSLInsecureRenegotiation off
    SSLCertificateFile /etc/httpd/ssl/example.com/example.com.crt
    SSLCertificateChainFile /etc/httpd/ssl/example.com/example.com.chain.crt
    SSLCertificateKeyFile /etc/httpd/ssl/example.com/example.com.key

</VirtualHost>

My Collabora Apache config:

<VirtualHost *:443>

    ServerName collabora.example.com
    ServerAdmin root@example.com

    ErrorLog /var/log/httpd/collabora.example.com_error.log
    CustomLog /var/log/httpd/collabora.example.com_access.log combined

    AllowEncodedSlashes NoDecode
    ProxyPreserveHost On

    SSLProxyEngine on
    SSLProxyVerify none
    SSLProxyCheckPeerCN off
    SSLProxyCheckPeerName off
    SSLProxyCheckPeerExpire off

    # main site
    ProxyPass / http://docker-node-01:9980/
    ProxyPassReverse / http://docker-node-01:9980/

    # static html, js, images, etc. served from coolwsd
    # browser is the client part of Collabora Online
    ProxyPass           /browser http://docker-node-01:9980/browser retry=0
    ProxyPassReverse    /browser http://docker-node-01:9980/browser

    # WOPI discovery URL
    ProxyPass           /hosting/discovery http://docker-node-01:9980/hosting/discovery retry=0
    ProxyPassReverse    /hosting/discovery http://docker-node-01:9980/hosting/discovery

    # Capabilities
    ProxyPass           /hosting/capabilities http://docker-node-01:9980/hosting/capabilities retry=0
    ProxyPassReverse    /hosting/capabilities http://docker-node-01:9980/hosting/capabilities

    # Main websocket
    ProxyPassMatch      "/cool/(.*)/ws$"      ws://docker-node-01:9980/cool/$1/ws nocanon

    # Admin Console websocket
    ProxyPass           /cool/adminws ws://docker-node-01:9980/cool/adminws

    # Download as, Fullscreen presentation and Image upload operations
    ProxyPass           /cool http://docker-node-01:9980/cool
    ProxyPassReverse    /cool http://docker-node-01:9980/cool

    # Compatibility with integrations that use the /lool/convert-to endpoint
    ProxyPass           /lool http://docker-node-01:9980/cool
    ProxyPassReverse    /lool http://docker-node-01:9980/cool

    ProxyPass / http://docker-node-01:9980/
    ProxyPassReverse / http://docker-node-01:9980/
    ProxyPassReverseCookiePath / /

    RequestHeader set Host "collabora.example.com"
    ProxyPreserveHost on
    ProxyRequests off

#    <Location "/">
#      SetOutputFilter Sed
#      OutputSed "s,http://docker-node-01:9980,https://collabora.example.com,g"
#      OutputSed "s,https://docker-node-01:9980,https://collabora.example.com,g"
#    </Location>



    # SSL
    SSLEngine on
    SSLProtocol all -SSLv2 -SSLv3
    SSLHonorCipherOrder on

    SSLCipherSuite "EECDH+ECDSA+AESGCM EECDH+aRSA+AESGCM \
                    EECDH+ECDSA+SHA384 EECDH+ECDSA+SHA256 \
                    EECDH+aRSA+SHA384 EECDH+aRSA+SHA256 \
                   EECDH EDH+aRSA \
                    !aNULL !eNULL !LOW !3DES !MD5 !EXP !PSK !SRP !DSS !RC4"

    SSLInsecureRenegotiation off
    SSLCertificateFile /etc/httpd/ssl/example.com/example.com.crt
   SSLCertificateChainFile /etc/httpd/ssl/example.com/example.com.chain.crt
    SSLCertificateKeyFile /etc/httpd/ssl/example.com/example.com.key

</VirtualHost>

The example.com is placeholder for my actual domain. I tried the sed rewrite theat is commented out but not works. Please help.

hi @johndoe4567 welcome to the forum :handshake:

take a look at this resources:

https://help.nextcloud.com/t/nextcloud-collabora-integration/151879

https://help.nextcloud.com/t/howto-ubuntu-docker-nextcloud-talk-collabora/76430

it should give you enough hint to solve the issue.

my first recommendation - start using TLS right away… without TLS almost nothing works today…

Thank you, this is helpful, I went step-by-step the second link, however after I put

http://office.example.com:9980

in Nextcloud’s Office URL settings, it seems fine (it says Collabora Online server is reachable.)
However, Once I open any document it loads for a few seconds, then I get

Document loading failed
Failed to load Nextcloude Office - please try again later

Docker doesn’t show any errors on either Collabora and Nextcloud containers, what do I do to troubleshoot this?

(it didn’t work without :9980 part)

please read and understand the articles I provided. your config violates guidelines provided there.