Problems Syncing NextCloud and OnlyOffice

I have based on a publication to install OnlyOffice on Docker and integrate it with NextCloud:

I followed your post to integrate Onlyoffice with NextCloud (using Docker) on a test machine. Of course I had to make some adjustments to your publication adapting it to my reality and my settings. I must mention that I first hear from Docker, which I force myself to read about. And it seems to me a tool with a lot of potential.
Well, to the point. I managed to run Onlyoffice and it already exits through the host’s actual port 8443 (Redirect virtual port 443 to real 8443). And on entering the web https: // <my_ip>: 8443 I redirected to the page https: // <my_ip>: 8443 / welcome / showing me the message “Document Server is running” and working correctly with https.
So far, everything was correct, and I was thrilled that after much effort, it was finally done to me.
Then, to integrate it with NextCloud, I installed the plugin for Onlyoffice. Then I go to [Administration / Additional Configuration] and go to the OnlyOffice section.
I enter the requested parameters [Address of the Document Editing Service: https: // <my_ip>: 8443 / and pressing , immediately leaves a message above that says “Error trying to establish the connection time limit)”.
However, from NextCloud I can create documents (docx, xlsx, pptx) without problems. The editor opens and saves the changes.
The problem arises that, modifications made to documents are in the cloud, but are not reflected in download.
For example, I have already created the document test.xls, I opened it with Onlyoffice and I edit it I create rows and columns, I format it, etc. etc. The changes are saved. When I open the document saved from the NexCloud web (click on the file), it opens Onlyoffice correctly. You see the changes made.
But … when I download the file in local, and open the document, the changes are not reflected. The same happens with the Android client, I downloaded the file but did not reflect the changes made in Onlyoffice.
Also with the PC client. The file is synchronized normally, but when you open the synchronized document locally, the changes are not reflected.
I re-open the file using web NexCloud, and Onlyoffice if you see the changes.
It is as if Onlyoffice will actually take a copy of the original file in a second space, it works in this second space but viculating it to the original file in NextCloud. When you make the changes you save them in this second space, but not in the original Nexcloud file.
So, when downloading the NexCloud file, download the file without changes. And when you open it from NexCloud with OnlyOffice, as you already have it linked to the second space, OnyOffice opens the second space file.
I must assume that some configuration or additional permission is missing, so OnlyOffice will effectively override the changes to the original file hosted in NextCloud.
I hope you apologize for the length of my message. And even more, I hope you help me.


Problemas al sincronizar NextCloud y OnlyOffice

Me he basado en una publicacion para instalar OnlyOffice sobre Docker e integrarlo con NextCloud:

Tuve que realizar algunos ajustes de a tu publicación adaptándolo a mi realidad y mis configuraciones. Logré hacer correr Onlyoffice y ya sale por el puerto 8443 real del host (Redireccionar el puerto 443 virtual al 8443 del real). Y al entrar a la web https://mi_ip:8443 me redirige a la pagina https://mi_ip:8443/welcome/ mostrandome el mensaje “Document Server is running” y funcionando correctamente con https.
Luego, para integrarlo con NextCloud, instalo el plugin para Onlyoffice. Luego voy a [Administracion / Configuracion adicional] y voy a la sección de OnlyOffice.
Ingreso los parametros solicitados [Dirección del Servicio de Edición de Documentos: https://mi_ip:8443/ y al presionar Enter, inmediatamente sale un mensaje arriba que dice “Error al intentar establecer la conexión (Solicitud Mala o error de límite de tiempo)”.
Sin embargo, desde NextCloud puedo crear documentos (docx, xlsx, pptx) sin problemas. Se abre el editor y guardan los cambios.
El problema es que las modificaciones realizadas a los documentos estan en la nube, pero no se reflejan en descarga.
Por ejemplo, ya he creado el documento prueba.xls, lo abrí con Onlyoffice y lo edito creo filas y columnas, le pongo formato, etc etc. Se guardan los cambios. Cuando abro el documento guardado desde la web NexCloud (click sobre el archivo), lo abre Onlyoffice correctamente. Se ven los cambios realizados.
Pero… cuando descargo el archivo en local, y abro el documento, no se ven reflejados los cambios. Los mismo sucede con el cliente de Android, descargo el archivo pero no se reflejan los cambios realizados en Onlyoffice.
Tambien con el cliente de PC. El archivo se sincroniza normal, pero al abrir el documento sincronizado en local, no se reflejan los cambios.
Vuelvo nuevamente a abrir el archivo usando web NexCloud, y Onlyoffice si ve los cambios.
Es como si Onlyoffice realmente sacara una copia del archivo original en un segundo espacio, lo trabaja en este segundo espacio pero viculándolo al archivo original en NextCloud. Cuando realiza los cambios los guarda en este segundo espacio, pero no en el archivo original de Nexcloud.
Asi que, al descargar el archivo de NexCloud, baja el archivo sin cambios. Y al abrirlo desde NexCloud con OnlyOffice, como ya lo tiene vinculado al segundo espacio, OnyOffice abre el archivo del segundo espacio.
Debo suponer que falta alguna configuración o permiso adicional, para que OnlyOffice vuelque los cambios de forma efectiva sobre el archivo original alojado en NextCloud.
Espero me disculpes lo extenso de mi mensaje. Y mas aun, espero me ayudes.

@UnderUp Did you find the solution? I have same problem right now.

Hi @wifilegal

Have you been able to solve your problem?

I believe the solution to this problem are correct settings for the HTTP headers and proxy

server {
    ## Headers
    add_header Referrer-Policy "no-referrer";

    add_header X-Frame-Options "ALLOW-FROM https://cloud.mydomain.tld/" always;
    add_header X-XSS-Protection "1; mode=block";
    add_header X-Robots-Tag none;
    add_header X-Download-Options noopen;
    add_header X-Permitted-Cross-Domain-Policies none;

    location / {
        proxy_pass         https://onlyoffice-docker;
        proxy_redirect     off;
        proxy_set_header   Host $host;
        proxy_set_header   X-Real-IP $remote_addr;
        proxy_set_header   X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_set_header   X-Forwarded-Host $server_name;

1 Like

Hi @Schmu

Where should i set these headers in nginx webserver from onlyoffice?

Hi @raphi59

Yes, in the nginx config file for Onlyoffice.
I assume you have a nextcloud web server config file and an onlyoffice config file under:

(or maybe under /etc/nginx/conf.d/ instead)

The onlyoffice config file may contain something like

server {
listen ssl http2;
location / {
# and so on

This configuration forwards/ proxies the web requests to the docker image. The header settings set some security settings and furthermore allow the access to Onlyoffice from the Nextcloud server:
add_header X-Frame-Options "ALLOW-FROM https://cloud.your-domain.tld/" always;
(please adapt the URL to the correct address of your nextcloud server)

1 Like

conector nextcloud in the onlyoffice connector change the display mode from original, one of the other final or change.