Can't connect Nexcloud to OnlyOffice Document Server

NextCloud and OnlyOffice Document Server (both behind Nginx Reverse Proxy which is taking care of SSL).
I got no errors while configuring the connector in NextCloud

I have tested OnlyOffice service by running the command at the welcome page and also worked without issues.

Start test example:
sudo docker exec e377789b7f83 sudo supervisorctl start ds:example

And I was able to create and edit documents and work normally with OnlyOffice without issues.

I have also checked connectivity between both servers using wget and they can see each other without issues.

Result from running wget from OnlyOffice container to NextCloud:

root@e377789b7f83:/bin# wget
--2023-10-19 09:24:46--
Resolving (,, 2a06:98c1:3120::5, ...
Connecting to (||:443... connected.
HTTP request sent, awaiting response... 302 Found
Location: [following]
--2023-10-19 09:24:46--
Reusing existing connection to
HTTP request sent, awaiting response... 200 OK
Length: unspecified [text/html]
Saving to: ‘index.html’

index.html                           [ <=>                                                    ]  15.58K  --.-KB/s    in 0.001s  

2023-10-19 09:24:46 (28.4 MB/s) - ‘index.html’ saved [15950]

Result from running wget from NextCloud to OnlyOffice:

root@f90ec22fd730:/# wget
Connecting to (
Connecting to (
saving to 'index.html'
index.html           100% |*********************************************************************************|  3701  0:00:00 ETA
'index.html' saved

But when trying to edit a document from NextCloud I get this error.


I have read multiple posts about similar issues but can’t figure out what is wrong in my case.
Any help would be much appreciated.

Try changing the password in the json.local file, the secret key.

Then delete the nextcloud plugin and download it again.

Is onlyoffice behind a firewall?
Does it have internet access?
That image appears when you edit or when you try to make the connection in the plugin, where do you put the documentserver IP and the secret key?

Do you have anything additional configured in the addon?

Hi @infinityysteel, thanks for helping out.

Try changing the password in the json.local file, the secret key.

I am using docker so I am providing that value trough the JWT_SECRET environment variable for that effect (instead of manually editing the local.json file)
I have checked the local.json file and it has the same password that I put on the JWT_SECRET environment variable and I have also changed it (both in the local.json and trough the JWT_SECRET and restarting the docker container) but that does not fix the issue.

Is onlyoffice behind a firewall?

Onlyoffice and Nextcloud are in the same server.
This server holds docker containers for both Only office and Nexcloud and they are in the same docker network, this server also hosts another docker container (in the same docker network) with Nginx Proxy Manager for reverse proxy management internet router (Firewall) is redirecting 443 traffic to the reverse proxy. I don’t think here is the issue as there is no firewall rule that is blocking any traffic between onlyoffice and nextcloud (if that is what you try to figure out with your question).

Does it have internet access?

Yes, I have tested it as you can see from the wget requests I did from both docker containers as mentioned in my previous post. They can see each other and they have internet access.

That image appears when you edit or when you try to make the connection in the plugin, where do you put the documentserver IP and the secret key?

The image appears when I click on any document associated with onlyoffice docx, pptx, etc.
I set the document server IP (a DNS really in my case) in nextcloud onlyoffice plugin setup page.
When I set the connection parameters in the plugin setup page I don’t get any errors, and a second part of added configuration parameters become available.
I have tried also to disable certificate validation (although is not something I would like leave in case it works) but that does not solve the issue either.

Do you have anything additional configured in the addon?

Not that I am aware off…

I am happy to provide any additional logs or configuration files if that helps.
Thanks again for taking the time to help.

Hi @infinityysteel .
I think I forgot to mention that I am using Cloudflare as application firewall.
After your comments I thought maybe that was the issue…
And I noticed the following
Everything works fine when Cloudflare application firewall is not enabled.
So for now at least It works !! :smiley: and I can use it but I am missing cloudflare protections.
However I would prefer to keep using cloudflare protections.

Do you (or someone) know how can I make it work even if I have cloudflare proxied enabled?

Is there a configuration file where I can put maybe trusted proxies?

Is that probably what is missing?

Thanks again.

That’s why I told you about the firewall, the image is similar to when we do not have full access to the internet (certain ports) since it did not show you the 504 error, now we know that the detail is in the firewall, which is why I told you that you did have rules . It is best to check what rules you have in Cloudflare.
I had a similar case, in which I had it through docker but it didn’t connect to me. Nextcloud and onlyoffice were the same docker, they communicated via network. For me it was not a problem to place onlyoffice somewhere else, so I clearly mounted it on a Linux with another IP and different output port. That is, onlyoffice places it at x.x.x.x:8000 and nextcloud at :80. And that’s it, I solved my problem.

If you really want to install and it is clear that you always have security, look for another port for the onlyoffice. Or enable tcp/udp for the specific port of the container where you have docker.

If you perform the action, tell us, it can help more people in the community with your tests.

Success, good day.

Hello @natrim

You should also consider information from this guide when configuring any proxy service with Document Server: