[GH-ISSUE #532] nextcloud to onlyoffice refused to connect. #258

Closed
opened 2026-02-26 10:31:23 +03:00 by kerem · 10 comments
Owner

Originally created by @Rhazzaz0r on GitHub (Oct 28, 2022).
Original GitHub issue: https://github.com/ONLYOFFICE/Docker-DocumentServer/issues/532

Hallo, I need help with a problem related to onlyoffice-document-server

I have a Traefik revers-proxy up and running.
Traefik gets the certificats from "Lets Encrypt"

behind that revers-proxy I have a nextcloud running and also
a onlyoffice-document-server.

everything works fine but when I try to open a document I get:
'my onlyoffice domain' refused to connect.

  • I checked ds:example: started works
  • I tryed curl from the nextcloud container to onlyoffice-document-server container and vice versa. works
  • I added the docker-container names to nextcloud configs trusted domains.
  • I added 'verify_peer_off' => TRUE, to nextcloud config
  • I checked all logfiles nothing out of the ordinary

does sonmeone else had that issue and fixed it?
Can someone help me please?

Originally created by @Rhazzaz0r on GitHub (Oct 28, 2022). Original GitHub issue: https://github.com/ONLYOFFICE/Docker-DocumentServer/issues/532 Hallo, I need help with a problem related to onlyoffice-document-server I have a Traefik revers-proxy up and running. Traefik gets the certificats from "Lets Encrypt" behind that revers-proxy I have a nextcloud running and also a onlyoffice-document-server. everything works fine but when I try to open a document I get: 'my onlyoffice domain' refused to connect. - I checked ds:example: started **works** - I tryed curl from the nextcloud container to onlyoffice-document-server container and vice versa. **works** - I added the docker-container names to nextcloud configs trusted domains. - I added 'verify_peer_off' => TRUE, to nextcloud config - I checked all logfiles **nothing out of the ordinary** does sonmeone else had that issue and fixed it? Can someone help me please?
kerem 2026-02-26 10:31:23 +03:00
  • closed this issue
  • added the
    duplicate
    label
Author
Owner

@vawaver commented on GitHub (Oct 29, 2022):

Hi,
I posted my problem which is similar to yours in Discussions.
Still waiting for a response.
URL - https://github.com/ONLYOFFICE/Docker-DocumentServer/discussions/534

<!-- gh-comment-id:1295955633 --> @vawaver commented on GitHub (Oct 29, 2022): Hi, I posted my problem which is similar to yours in Discussions. Still waiting for a response. URL - https://github.com/ONLYOFFICE/Docker-DocumentServer/discussions/534
Author
Owner

@Rhazzaz0r commented on GitHub (Nov 15, 2022):

Is there any update? Can someone help please?

<!-- gh-comment-id:1315225881 --> @Rhazzaz0r commented on GitHub (Nov 15, 2022): Is there any update? Can someone help please?
Author
Owner

@hmt commented on GitHub (Feb 3, 2023):

Have you set the Secret? You will probably need to add the token from local.json which you find inside the container under : /etc/onlyoffice/documentserver-example/local.json

<!-- gh-comment-id:1415782533 --> @hmt commented on GitHub (Feb 3, 2023): Have you set the Secret? You will probably need to add the token from local.json which you find inside the container under : `/etc/onlyoffice/documentserver-example/local.json`
Author
Owner

@vawaver commented on GitHub (Feb 3, 2023):

Have you set the Secret? You will probably need to add the token from local.json which you find inside the container under : /etc/onlyoffice/documentserver-example/local.json

Can you be moreprecise and give a short instruction of what needs to be done?
I'm not an IT pro, but I could handle it if I knew exactly what to do.

<!-- gh-comment-id:1415970959 --> @vawaver commented on GitHub (Feb 3, 2023): > Have you set the Secret? You will probably need to add the token from local.json which you find inside the container under : `/etc/onlyoffice/documentserver-example/local.json` Can you be moreprecise and give a short instruction of what needs to be done? I'm not an IT pro, but I could handle it if I knew exactly what to do.
Author
Owner

@hmt commented on GitHub (Feb 3, 2023):

There is a simpler solution: When you start your container like this here:

sudo docker run -i -t -d -p 80:80 onlyoffice/documentserver

Your setup will probably look a bit different, maybe you want to add volumes etc. But the point is, add an env var for a secure token like this:

sudo docker run -i -t -d -p 80:80 -e JWT_SECRET=somesupersecretstring onlyoffice/documentserver

This token needs to be added to your NextCloud settings. Go to settings/admin/onlyoffice -> Secret key

<!-- gh-comment-id:1415983296 --> @hmt commented on GitHub (Feb 3, 2023): There is a simpler solution: When you start your container like this here: sudo docker run -i -t -d -p 80:80 onlyoffice/documentserver Your setup will probably look a bit different, maybe you want to add volumes etc. But the point is, add an env var for a secure token like this: sudo docker run -i -t -d -p 80:80 -e JWT_SECRET=somesupersecretstring onlyoffice/documentserver This token needs to be added to your NextCloud settings. Go to `settings/admin/onlyoffice` -> Secret key
Author
Owner

@vawaver commented on GitHub (Feb 5, 2023):

@hmt > This token needs to be added to your NextCloud settings. Go to settings/admin/onlyoffice -> Secret key

I am stuck on settings on how to connect Nextcloud snap to this only Onlyoffice docker. Both are alongside on the same Linux server but I am not able to open/edit any document.
Can you recommend some tutorials on how to set it up? Both are behind Nginx proxy server. I do not know if it needs some advanced settings or not.

<!-- gh-comment-id:1418276902 --> @vawaver commented on GitHub (Feb 5, 2023): @hmt > This token needs to be added to your NextCloud settings. Go to `settings/admin/onlyoffice` -> Secret key I am stuck on settings on how to connect Nextcloud snap to this only Onlyoffice docker. Both are alongside on the same Linux server but I am not able to open/edit any document. Can you recommend some tutorials on how to set it up? Both are behind Nginx proxy server. I do not know if it needs some advanced settings or not.
Author
Owner

@hmt commented on GitHub (Feb 6, 2023):

I have Apache and set up on two different servers. Sorry, can't really help you with that. There are some gists floating around if you search on Github.

<!-- gh-comment-id:1418651322 --> @hmt commented on GitHub (Feb 6, 2023): I have Apache and set up on two different servers. Sorry, can't really help you with that. There are some gists floating around if you search on Github.
Author
Owner

@talesam commented on GitHub (Mar 31, 2023):

JWT_SECRET=somesupersecretstring

I used version 7.1.1 and didn't need a token, what I did was, I updated it, and I uploaded my docker-composer like this:

version: '3.9'

services:
  onlyoffice:
    container_name: onlyoffice
    image: onlyoffice/documentserver:latest
    restart: always
    environment:
      JWT_SECRET: PASSWD
    volumes:
      - /home/tales/Docker/OnlyOffice/data:/var/www/onlyoffice/Data:rw
      - /home/tales/Docker/OnlyOffice/logs:/var/log/onlyoffice
      - /home/tales/Docker/OnlyOffice/fonts/truetype/custom:/usr/share/fonts/truetype/custom
      - /home/tales/Docker/OnlyOffice/plugins:/var/www/onlyoffice/documentserver/sdkjs-plugins
    expose:
      - 80
      - 443
    networks:
      t4l35-net:

networks:
  t4l35-net:
    name: t4l35-net
    ```
    But it does not connect to nextcloud
<!-- gh-comment-id:1492696420 --> @talesam commented on GitHub (Mar 31, 2023): > JWT_SECRET=somesupersecretstring I used version 7.1.1 and didn't need a token, what I did was, I updated it, and I uploaded my docker-composer like this: ``` version: '3.9' services: onlyoffice: container_name: onlyoffice image: onlyoffice/documentserver:latest restart: always environment: JWT_SECRET: PASSWD volumes: - /home/tales/Docker/OnlyOffice/data:/var/www/onlyoffice/Data:rw - /home/tales/Docker/OnlyOffice/logs:/var/log/onlyoffice - /home/tales/Docker/OnlyOffice/fonts/truetype/custom:/usr/share/fonts/truetype/custom - /home/tales/Docker/OnlyOffice/plugins:/var/www/onlyoffice/documentserver/sdkjs-plugins expose: - 80 - 443 networks: t4l35-net: networks: t4l35-net: name: t4l35-net ``` But it does not connect to nextcloud
Author
Owner

@iPCNet commented on GitHub (Feb 14, 2025):

Hi @Rhazzaz0r

I had a similar issue, got it fixed... you need some middleware configs.
Took me ages to figure everything out

Here is my compose file (you need to replace the *** for your config)
Hope this helps:

services:
   onlyoffice:
     image: onlyoffice/documentserver:latest
     restart: always
     volumes:
      - onlyoffice:/var/www/onlyoffice/Data
      - onlylog:/var/log/onlyoffice
      - onlytype:/usr/share/fonts/truetype/custom
      - onlylib:/var/lib/onlyoffice
      - onlysql:/var/lib/postgresql
      - onlyrmq:/var/lib/rabbitmq
      - onlyredis:/var/lib/redis

     environment:
     - JWT_ENABLED=true
     - JWT_SECRET=***
  
     labels:
        - "traefik.enable=true"
        - "traefik.http.routers.onlyoffice.tls=true"
        - "traefik.http.routers.onlyoffice.tls.certresolver=production"
        - "traefik.http.routers.onlyoffice.entrypoints=websecure"
        - "traefik.http.routers.onlyoffice.rule=Host(`***`)"

        - "traefik.http.middlewares.onlyoffice-headers.headers.customResponseHeaders.X-Robots-Tag=none"
        - "traefik.http.middlewares.onlyoffice-headers.headers.customResponseHeaders.Strict-Transport-Security=max-age=63072000"
        - "traefik.http.middlewares.onlyoffice-headers.headers.browserXssFilter=true"
        - "traefik.http.middlewares.onlyoffice-headers.headers.contentTypeNosniff=true"
        - "traefik.http.middlewares.onlyoffice-headers.headers.stsIncludeSubdomains=true"
        - "traefik.http.middlewares.onlyoffice-headers.headers.stsPreload=true"
        - "traefik.http.middlewares.onlyoffice-headers.headers.stsSeconds=31536000"
        - "traefik.http.middlewares.onlyoffice-headers.headers.forceSTSHeader=true"
        - "traefik.http.middlewares.onlyoffice-headers.headers.accessControlMaxAge=15552000"

        - "traefik.http.middlewares.onlyoffice-headers.headers.customrequestheaders.X-Forwarded-Proto=https"
        - "traefik.http.middlewares.onlyoffice-headers.headers.accesscontrolalloworiginlist=*"
        - "traefik.http.routers.onlyoffice.middlewares=onlyoffice-headers"
<!-- gh-comment-id:2660369050 --> @iPCNet commented on GitHub (Feb 14, 2025): Hi @Rhazzaz0r I had a similar issue, got it fixed... you need some middleware configs. Took me ages to figure everything out Here is my compose file (you need to replace the *** for your config) Hope this helps: ``` services: onlyoffice: image: onlyoffice/documentserver:latest restart: always volumes: - onlyoffice:/var/www/onlyoffice/Data - onlylog:/var/log/onlyoffice - onlytype:/usr/share/fonts/truetype/custom - onlylib:/var/lib/onlyoffice - onlysql:/var/lib/postgresql - onlyrmq:/var/lib/rabbitmq - onlyredis:/var/lib/redis environment: - JWT_ENABLED=true - JWT_SECRET=*** labels: - "traefik.enable=true" - "traefik.http.routers.onlyoffice.tls=true" - "traefik.http.routers.onlyoffice.tls.certresolver=production" - "traefik.http.routers.onlyoffice.entrypoints=websecure" - "traefik.http.routers.onlyoffice.rule=Host(`***`)" - "traefik.http.middlewares.onlyoffice-headers.headers.customResponseHeaders.X-Robots-Tag=none" - "traefik.http.middlewares.onlyoffice-headers.headers.customResponseHeaders.Strict-Transport-Security=max-age=63072000" - "traefik.http.middlewares.onlyoffice-headers.headers.browserXssFilter=true" - "traefik.http.middlewares.onlyoffice-headers.headers.contentTypeNosniff=true" - "traefik.http.middlewares.onlyoffice-headers.headers.stsIncludeSubdomains=true" - "traefik.http.middlewares.onlyoffice-headers.headers.stsPreload=true" - "traefik.http.middlewares.onlyoffice-headers.headers.stsSeconds=31536000" - "traefik.http.middlewares.onlyoffice-headers.headers.forceSTSHeader=true" - "traefik.http.middlewares.onlyoffice-headers.headers.accessControlMaxAge=15552000" - "traefik.http.middlewares.onlyoffice-headers.headers.customrequestheaders.X-Forwarded-Proto=https" - "traefik.http.middlewares.onlyoffice-headers.headers.accesscontrolalloworiginlist=*" - "traefik.http.routers.onlyoffice.middlewares=onlyoffice-headers" ```
Author
Owner

@igwyd commented on GitHub (May 12, 2025):

Duplicate of #https://github.com/ONLYOFFICE/DocumentServer/issues/2162

<!-- gh-comment-id:2872183977 --> @igwyd commented on GitHub (May 12, 2025): Duplicate of #https://github.com/ONLYOFFICE/DocumentServer/issues/2162
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/Docker-DocumentServer-ONLYOFFICE#258
No description provided.