redirect to websecure

This commit is contained in:
Yax 2020-06-28 16:05:34 +02:00
parent 23555aa71b
commit 0bfc7e0890
2 changed files with 8 additions and 5 deletions

View file

@ -18,9 +18,11 @@ services:
labels:
- traefik.enable=true
- traefik.http.routers.glances.rule=Host(`${HOST_GLANCES}.${DOMAIN}`)
- traefik.http.routers.glances.entrypoints=web
- traefik.http.routers.glances.entrypoints=websecure
- traefik.http.routers.glances.tls=true
- traefik.http.routers.glances.tls.certresolver=letsencrypt
- traefik.http.routers.glances.middlewares=redirect-to-https
- traefik.http.services.glances.loadbalancer.server.port=61208
volumes:

View file

@ -16,17 +16,18 @@ services:
labels:
- traefik.enable=true
- traefik.http.routers.dashboard.rule=Host(`${HOST_TRAEFIK}.${DOMAIN}`)
- traefik.http.routers.dashboard.entrypoints=web
- traefik.http.routers.dashboard.entrypoints=websecure
- traefik.http.routers.dashboard.tls=true
- traefik.http.routers.dashboard.tls.certresolver=letsencrypt
- traefik.http.routers.dashboard.tls.certresolver=letsencrypt
- traefik.http.services.dashboard.loadbalancer.server.port=8080
# global redirect to https
- traefik.http.routers.http-catchall.rule=hostregexp(`{host:.+}`)
- traefik.http.routers.http-catchall.entrypoints=web
- traefik.http.routers.http-catchall.middlewares=redirect-to-https
#- traefik.http.routers.http-catchall.rule=hostregexp(`{host:.+}`)
#- traefik.http.routers.http-catchall.entrypoints=web
#- traefik.http.routers.http-catchall.middlewares=redirect-to-https
# middleware redirect
- traefik.http.middlewares.redirect-to-https.redirectscheme.scheme=https
- traefik.http.middlewares.redirect-to-https.redirectscheme.permanent=false
- traefik.http.middlewares.redirect-to-https.redirectscheme.permanent=true
ports:
- 80:80
- 443:443