From 8fd04b0258a202e90d610dd72b54e6b9947ca1f6 Mon Sep 17 00:00:00 2001 From: Joey Hafner Date: Mon, 21 Nov 2022 14:58:33 -0800 Subject: [PATCH] #67 Split middleware into two, add both --- homelab/server/config/nextcloud/docker-compose.yml | 2 +- homelab/server/config/traefik/config/middlewares.yaml | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/homelab/server/config/nextcloud/docker-compose.yml b/homelab/server/config/nextcloud/docker-compose.yml index 1f59e7b5..b819adc6 100644 --- a/homelab/server/config/nextcloud/docker-compose.yml +++ b/homelab/server/config/nextcloud/docker-compose.yml @@ -16,7 +16,7 @@ services: labels: - traefik.http.routers.nextcloud.rule=Host(`nextcloud.jafner.net`) - traefik.http.routers.nextcloud.tls.certresolver=lets-encrypt - - traefik.http.routers.nextcloud.middlewares=nextcloud@file + - traefik.http.routers.nextcloud.middlewares=nextcloud-headers@file,nextcloud-redirect@file #- traefik.http.services.nextcloud.loadbalancer.server.scheme=https #- traefik.http.services.nextcloud.loadbalancer.server.port=443 networks: diff --git a/homelab/server/config/traefik/config/middlewares.yaml b/homelab/server/config/traefik/config/middlewares.yaml index 44b16b7f..53512d6c 100644 --- a/homelab/server/config/traefik/config/middlewares.yaml +++ b/homelab/server/config/traefik/config/middlewares.yaml @@ -52,7 +52,7 @@ http: trustForwardHeader: true authResponseHeaders: - X-Forwarded-User - nextcloud: + nextcloud-headers: headers: accessControlMaxAge: 100 sslRedirect: true @@ -71,6 +71,7 @@ http: customResponseHeaders: X-Robots-Tag: "none" server: "" + nextcloud-redirect: redirectRegex: permanent: true regex: "https://(.*)/.well-known/(card|cal)dav"