I can't seem to get Traefik to set headers:
I have the following labels in my docker-compose.yml file:
services:
nextcloud:
image: 'nextcloud:latest'
container_name: nextcloud
build: .
networks:
- proxy
- nextcloud
volumes:
- nextcloud:/var/www/html
environment:
- TZ=$TIMEZONE
- MYSQL_HOST=$MYSQL_HOST
- MYSQL_DATABASE=$MYSQL_DATABASE
- MYSQL_USER=$MYSQL_USER
- MYSQL_PASSWORD=$MYSQL_PASSWORD
- REDIS_HOST=nextcloud_redis
- REDIS_HOST_PASSWORD=$REDIS_PASSWORD
- NEXTCLOUD_ADMIN_USER=$NEXTCLOUD_ADMIN_USER
- NEXTCLOUD_ADMIN_PASSWORD=$NEXTCLOUD_ADMIN_PASSWORD
- SMTP_HOST=$SMTP_HOST
- SMTP_SECURE=$SMTP_SECURE
- SMTP_PORT=$SMTP_PORT
- SMTP_AUTHTYPE=$SMTP_AUTHTYPE
- SMTP_NAME=$SMTP_NAME
- SMTP_PASSWORD=$SMTP_PASSWORD
- MAIL_FROM_ADDRESS=$MAIL_FROM_ADDRESS
- MAIL_DOMAIN=$MAIL_DOMAIN
- APACHE_DISABLE_REWRITE_IP=1
- TRUSTED_PROXIES=192.168.80.0/20
depends_on:
- nextcloud_redis
restart: unless-stopped
labels:
- "traefik.enable=true"
- "traefik.http.routers.cloud.entrypoints=http"
- "traefik.http.routers.cloud.rule=Host(`$HOST.$DOMAIN`)"
- "traefik.http.middlewares.cloud-https-redirect.redirectscheme.scheme=https"
- "traefik.http.routers.cloud.middlewares=cloud-https-redirect"
- "traefik.http.routers.cloud-secure.entrypoints=https"
- "traefik.http.routers.cloud-secure.rule=Host(`$HOST.$DOMAIN`)"
- "traefik.http.routers.cloud-secure.tls=true"
- "traefik.http.routers.cloud-secure.tls.certresolver=le"
- "traefik.http.routers.cloud-secure.service=cloud"
- "traefik.http.services.cloud.loadbalancer.server.port=80"
- "traefik.docker.network=proxy"
- "traefik.http.middlewares.cloud.headers.customFrameOptionsValue=SAMEORIGIN"
- "traefik.http.middlewares.cloud.headers.framedeny=true"
- "traefik.http.middlewares.cloud.headers.sslredirect=true"
- "traefik.http.middlewares.cloud.headers.STSIncludeSubdomains=true"
- "traefik.http.middlewares.cloud.headers.STSPreload=true"
- "traefik.http.middlewares.cloud.headers.STSSeconds=315360000"
- "traefik.http.middlewares.cloud.headers.forceSTSHeader=true"
- "traefik.http.middlewares.cloud.headers.sslProxyHeaders.X-Forwarded-Proto=https"
- "traefik.http.middlewares.cloud-dav.replacepathregex.regex=^/.well-known/ca(l|rd)dav"
- "traefik.http.middlewares.cloud-dav.replacepathregex.replacement=/remote.php/dav/"
I have also verified under Traefik HTTP Middlewares that the cloud@docker is showing the following:
STS SECONDS 315360000
STS INCLUDE SUBDOMAINS True
STS PRELOAD True
FORCE STS HEADER True
FRAME DENY True
Yet I'm not seeing those response headers. I'm sure I'm doing something stupid but I can't figure out what.
Thanks in advance