ONLYOFFICE cannot be reached externally

Hi,
I’ve installed NextCloud on a server and OnlyOffice on another. I’ve done all the work and everything seems to be working just fine. When I try to open/create a document within local network it works fine but as soon as I try to open the same document or create new one from an external network then I get the error as shown in the image. I need this sorted and willing to give access to the right person to look into this matter. Would highly appreciate if someone could help me out here, many thanks.

Regards,
M Alam.
onlyoffice external error

If you call onlyoffice via nextcloud from the internet, the clientbrowser must have access to the onlyoffice server on its own, so just give it an officially reachable domain. That should do.

1 Like

Hi,
Thanks for the response. OK so with your suggestion I’ll have to setup a reverse proxy server because my router can’t differentiate between nextcloud and onlyoffice traffic (both running http). Will have to work that out and see whether that resolves it, I’ll notify you with an update, thanks once again.

Cheers.

1 Like

I can provide my nginx config where I solved the same problem. Nextcloud and Onlyoffice (with their own domain names) on one machine and only listening on Port 443. So let me know if you need assistance.

Yes please, that would be awesome, also please make side notes of things that need my own settings if possible. By the way my nextcloud and onlyoffice is on different machines, would it make any difference. If you can share me the installation guide of both nextcloud & onlyoffice on the same server as well then it’d highly appreciated. Many thanks.

For Nextcloud and Onlyoffice on different machines I cannot really help with my config and I’m not familiar with setting up reverse proxies.
But maybe there are some good hints in the logs that help to solve the problem for your current setup.

When it comes to Nextcloud and Onlyoffice on the same machine, there is not much to do.
I used the onlyoffice/documentserver docker image and just configured my web server (nginx) to:

  • listen on Port 80 & 443 for nextcloud.mydomain.tld
  • listen on Port 80 & 443 for onlyoffice.mydomain.tld
  • forward requests for onlyoffice.mydomain.tld to docker (local-ip:8443)

So for me docker was the most simple solution and it’s working great.

Hi mate,
Thanks for your help, I’vee actually managed to get it going with github image which has both NC & OO integrated in docker, its working like a charm now. However, at the moment I’m running it on http and not https. Will need suggestions, by the way my domain has https but it does not support subdomain certificates. So can i use letsencrypt to certify my subdomain?? Would appreciate your advise, many thanks.

Regards,
Alam.

Hi mate,

Sure, you can achieve that with Let’s Encrypt. It’s the same what I did and with Let’s Encrypt you can request as many certificates for domains and subdomains as you like.
The good news in addition: starting in February Let’s Encrypt will support wild card certificates, so you can request a certificate for yourdomain.tld and can use this cert for

  • subdomain1.yourdomain.tld
  • subdomain2.yourdomain.tld
  • subdomain3.yourdomain.tld

So it will get easier and more comfortable :slight_smile:

I configured certbot to place the certs under:
/etc/letsencrypt/live/ (there are subfolders for each subdomain)

and in nginx (which forwards the requests accordingly as mentioned above) I defined the SSL-certificates like that (shortened):

server {
    listen 443 ssl http2;
    listen [::]:443 ssl http2;
    server_name cloud.mydomain.tld;
    ...
    ssl_certificate /etc/letsencrypt/live/cloud.mydomain.tld/fullchain.pem; # managed by Certbot
    ssl_certificate_key /etc/letsencrypt/live/cloud.mydomain.tld/privkey.pem; # managed by Certbot
    ...
}

server {
    listen 443 ssl http2;
    listen [::]:443 ssl http2;
    server_name office.mydomain.tld;
    ...
    ssl_certificate /etc/letsencrypt/live/office.mydomain.tld/fullchain.pem; # managed by Certbot
    ssl_certificate_key /etc/letsencrypt/live/office.mydomain.tld/privkey.pem; # managed by Certbot
    ...
}

The comments are added automatically when you let Certbot renew your certs automatically.
Hope this help :slight_smile: