Open OnlyOffice from internal and external network not possible

Hey everyone!

I have a setup of Nextcloud 18 with OnlyOffice integration.
That setup works very well but it is limited somehow.
So I have a reverse proxy and I can connect to it from my local network and external network using cloud.mydomain.com.

For OnlyOffice you can edit the config and add only one address to the installation.
You can enter http://192.1.2.3/document … or https://cloud.mydomain.com/document

What if I want to get this working on both locations?

Thanks

Cheers and stay healthy!

Hey Knex,

It is doable for sure, I do it here. What you need is a URL that will be reachable from both inside and outside.

If you put it as 192.168.x.y, a client outside the network will not be able to reach the server for obvious reasons.

What you need is to make your external URL valid not only from outside, but also from inside. Your Nextcloud server must be able to reach the OnlyOffice when calling it by his outside name.

One option is to do split-DNS, having one DNS answer for clients from inside and one for clients outside. Another option is for your proxy to accept and forward requests from inside even when sent to its outside address.

Once your Nextcloud server is able to reach OnlyOffice using the external name, it should be good.

Here, my frontend proxy is HAProxy and I do split-DNS. Clients reach it from outside using the public name. Internally, my DNS resolver returns the onlyoffice’ internal IP. When requests are received from outside, HAProxy checks for a client side SSL certificate before letting one in. From inside, no such double check and the servers talk to each other freely.

2 Likes

That was too easy. Thanks a lot. I just added it to my dnsmasq server and it works very well. I never even hat that idea. I had some troubble with HSTS but not it works.
Thanks!

Split DNS is practically a necessity for this, but it isn’t talked about or documented enough. I have to recommend (and explain) it frequently.