Do you want to: Ask a how-to question (or Report a bug not so sure)
Document Server version: How do I check?
Type of installation of the Document Server: docker
OS: docker
Browser version: Firefox 96.0.3
Hello, I’m trying to setup document server in my server at address docs.example. com behind traefik v2. All of this using the docker-compose guide
The guide works well without traefik, but when starting traefik and commenting the ports section as shown below, the documents do not load. When creating a new doc in the example page, I’m redirected to a new tab at https://docs.example.com/editor?fileName=new.docx and I get the error “Cannot GET /editor”.
However, I can go back to the example page and open the example document that was created, this opens the editor but the document does not load. Resulting in this error
.
Please help
docker-compose.yml
version: '2'
services:
onlyoffice-documentserver:
build:
context: .
container_name: onlyoffice-documentserver
depends_on:
- onlyoffice-postgresql
- onlyoffice-rabbitmq
environment:
- DB_TYPE=postgres
- DB_HOST=onlyoffice-postgresql
- DB_PORT=5432
- DB_NAME=onlyoffice
- DB_USER=onlyoffice
- AMQP_URI=amqp://guest:guest@onlyoffice-rabbitmq
# Uncomment strings below to enable the JSON Web Token validation.
#- JWT_ENABLED=true
#- JWT_SECRET=secret
#- JWT_HEADER=Authorization
#- JWT_IN_BODY=true
# ports:
# - '80:80'
# - '443:443'
stdin_open: true
restart: always
stop_grace_period: 60s
networks:
onlyOfficeInternal:
traefik:
volumes:
- /var/www/onlyoffice/Data
- /var/log/onlyoffice
- /var/lib/onlyoffice/documentserver/App_Data/cache/files
- /var/www/onlyoffice/documentserver-example/public/files
- /usr/share/fonts
labels:
- traefik.enable=true
- traefik.http.routers.docs.rule=Host(`docs.example.com`)
- traefik.http.routers.docs.tls=true
- traefik.http.routers.docs.tls.certresolver=le
- traefik.http.services.docs.loadbalancer.server.port=80
- traefik.http.routers.docs.service=docs
- traefik.http.routers.docs.entrypoints=websecure
- traefik.docker.network=traefik
- traefik.http.routers.docs-http.entrypoints=web
- traefik.http.routers.docs-http.rule=Host(`docs.example.com`)
- traefik.http.routers.docs-http.middlewares=https-redirect
onlyoffice-rabbitmq:
container_name: onlyoffice-rabbitmq
image: rabbitmq
restart: always
networks:
onlyOfficeInternal:
expose:
- '5672'
onlyoffice-postgresql:
container_name: onlyoffice-postgresql
image: postgres:9.5
networks:
onlyOfficeInternal:
environment:
- POSTGRES_DB=onlyoffice
- POSTGRES_USER=onlyoffice
- POSTGRES_HOST_AUTH_METHOD=trust
restart: always
expose:
- '5432'
volumes:
- postgresql_data:/var/lib/postgresql
volumes:
postgresql_data:
networks:
onlyOfficeInternal:
traefik:
external: true
Carl
7 February 2022 08:55
2
Hello,
I’d recommend connecting the Document Server to some other service to check the functionality as our embedded example service is not intended to work behind a proxy.
Also please make sure to follow our Traefik example configs for correct proxying to the Document Server:
Hi, @IrArevalo
Do you find solution?
I’ve had this working using docker-compose.yml and also using a file provider for Traefik (the same rules apply, but using YAML instead of labels for the file provider).
You need to set up some middleware headers:
http:
routers:
onlyoffice:
tls:
certResolver: "cloudflare"
entrypoints:
- "websecure"
rule: "Host(`onlyoffice.mydomain.co.uk`)"
service: "onlyoffice"
middlewares: "onlyoffice-headers"
services:
onlyoffice:
loadBalancer:
servers:
- url: "http://192.168.1.12/"
middlewares:
onlyoffice-headers:
headers:
customRequestHeaders:
X-Forwarded-Proto: "https"
accessControlAllowOriginList:
- "*"
Hope that helps.
Bonjour
I’m very sorry, I forgot to answer here.
I found a solution:
opened 03:39PM - 16 May 22 UTC
**Do you want to request a *feature* or report a *bug*?**
Bug
**What is the … current behavior?**
Unable to configure traefik v2 with onlyoffice
I can reach the welcome page, but when I try example, I get:
```
502 Bad Gateway
nginx
```
**If the current behavior is a bug, please provide the steps to reproduce and if possible a minimal demo of the problem.**
My traefik tags:
```
"traefik.enable=true",
"traefik.http.routers.onlyoffice.tls=true",
"traefik.http.routers.onlyoffice.tls.certresolver=myresolver",
"traefik.http.routers.onlyoffice.tls.options=mintls12@file",
"traefik.http.routers.onlyoffice.entrypoints=https",
"traefik.http.routers.onlyoffice.rule=Host(`office.nextcloud.domain.com`)",
"traefik.http.middlewares.onlyoffice.redirectscheme.scheme=https",
"traefik.http.middlewares.onlyoffice.redirectscheme.permanent=true",
"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.frameDeny=true",
"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.customFrameOptionsValue=SAMEORIGIN",
"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@consulcatalog",
```
**What is the expected behavior?**
Passed example and integrate to nextcloud.
**Did this work in previous versions of DocumentServer?**
First install in standalone docker
Works with onlyoffice from apps store nextcloud, but I prefer to outsource onlyoffice
**DocumentServer version:**
7.0.1.37
**Operating System:**
Ubuntu 22.04
Docker version 20.10.15
Nomad 1.2.6
Traefik v2.6.1
**Browser version:**
Firefox 100
🤔
Thanks