OnlyOffice Connection Refused (Snap install) <resolved>

I was having an issue with OnlyOffice on a new installation. When the system was freshly installed, running HTTP protocol, using local IP address for navigation via web browser, OnlyOffice worked fine. When I imported my SSL certs and added a trusted domain to the snap install, I kept getting a warning when trying to configure OnlyOffice in settings that stated:

“https://<server_address>:<https_port>/index.php/apps/documentserver_community/ Connection Refused”.

I figured out if i set all addresses in “Advanced Server Settings” to the local ip of the NextCloud Server, It Works.

I searched the Forums and could not resolve this issue. I stumbled across the solution by accident, so i wanted to pass my knowledge forward in case anyone else was having the same issue.

System:
Ubuntu Server v 20.04
AMD x64 Architecture
NextCloud(Snap Install)

In Order, these are the steps I took that resolved my issue.

In Ubuntu Terminal as root:

ADD TRUSTED DOMAIN
snap run nextcloud.occ config:system:set trusted_domains 1 --value=<domain_name>

Optional. Defualt ports are HTTP port as 80 and HTTPS port as 443
SET PORTS
snap set nextcloud ports.http= ports.https=

SET CERTS

  1. Change names
    certificate.crt to cert.pem
    private.key to privkey.pem
    CA.cert to chain.pem
  2. Copy all certs to
    /var/snap/nextcloud/current/certs/
  3. Execute cmd
    sudo nextcloud.enable-https custom -s cert.pem privkey.pem chain.pem

NextCloud(web-ui) >Settings>OnlyOffice
4. OnlyOffice Config:
a) Document Editing Service address:
domain of Nextcloud – https://<domain_name>:
<https_port>/index.php/apps/documentserver_community/
b) Advanced Server Settings:
i) Domcument Editing Service address and Server address
for internal request:
https://<local_ip_addr>:<https_port>/index.php
/apps/documentserver_community/

Hope this helps someone.