# Dynamic config for OnlyOffice

**URL:** <https://community.traefik.io/t/dynamic-config-for-onlyoffice/27334>\
**Category:** Traefik v3 (latest)\
**Tags:** middleware\
**Created:** [April 27, 2025, 5:52am UTC](https://community.traefik.io/t/dynamic-config-for-onlyoffice/27334 "2025-04-27T05:52:22Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![stilicho2011](https://sea2.discourse-cdn.com/flex020/user_avatar/community.traefik.io/stilicho2011/32/10319_2.png) [@stilicho2011](https://community.traefik.io/u/stilicho2011)\
**Post date:** [April 27, 2025, 5:52am UTC](https://community.traefik.io/t/dynamic-config-for-onlyoffice/27334/1 "2025-04-27T05:52:22Z")

</div>

Hello!  
I have a problem with dynamic config for OnlyOffice.  
Here is my middleware chain for OO

```auto
        middlewares:
        # Middleware chain for Nextcloud
        onlyoffice-chain:
            chain:
                middlewares:
                    # - ... (e.g. rate limiting middleware)
                    - https-redirect
                    - onlyoffice-secure-headers
                    - default-headers
                    - onlyoffice-redirectregex

        onlyoffice-redirectregex:
            redirectRegex:
                regex: "https://(.*)/.well-known/(?:card|cal)dav"
                replacement: "https://$${1}/remote.php/dav"

        onlyoffice-secure-headers:
            headers:
                hostsProxyHeaders:
                    - "X-Forwarded-Host"
                referrerPolicy: "same-origin"
                customResponseHeaders:
                    X-Robots-Tag: "noindex, nofollow"

        default-headers:
            headers:
                frameDeny: true
                browserXssFilter: true
                contentTypeNosniff: true
                forceSTSHeader: true
                stsIncludeSubdomains: true
                stsPreload: true
                stsSeconds: 15552000
                customFrameOptionsValue: SAMEORIGIN
                customRequestHeaders:
                    X-Forwarded-Proto: https

```

Traefik issues cert for OnlyOffice, I can connect Nextcloud with OnlyOffice via connector. The problem is that I can't open any document in Nextcloud. I suppose due to security reasons. However, as standalone server OnlyOffice works perfect. I understand that i mess up with middlewares but can't figure out where I missed something.  
I would much appreciate with help

---

<div class="post-metadata">

**Author:** ![bluepuma77](https://avatars.discourse-cdn.com/v4/letter/b/a9adbd/32.png) [@bluepuma77](https://community.traefik.io/u/bluepuma77)\
**Post date:** [April 27, 2025, 3:11pm UTC](https://community.traefik.io/t/dynamic-config-for-onlyoffice/27334/2 "2025-04-27T15:11:02Z")

</div>

Enable and check Traefik debug log for more log output. Some of your header definitions seem strange (should indicate request or response), check [doc](https://doc.traefik.io/traefik/middlewares/http/headers/).
