-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdc-traefik-https-redirect.yml
More file actions
19 lines (17 loc) · 1008 Bytes
/
Copy pathdc-traefik-https-redirect.yml
File metadata and controls
19 lines (17 loc) · 1008 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
version: '3'
services:
service_https_redirect:
labels:
#uses .env TRAEFIK_CONFIG_SERVICE, TRAEFIK_CONFIG_HOST
#service + https
- "traefik.enable=true"
- "traefik.http.routers.${TRAEFIK_CONFIG_SERVICE}-https.rule=Host(`${TRAEFIK_CONFIG_HOST}`)"
- "traefik.http.routers.${TRAEFIK_CONFIG_SERVICE}-https.entrypoints=websecure"
- "traefik.http.routers.${TRAEFIK_CONFIG_SERVICE}-https.tls=true"
- "traefik.http.routers.${TRAEFIK_CONFIG_SERVICE}-https.tls.certresolver=le"
#http route + redirect
- "traefik.http.routers.${TRAEFIK_CONFIG_SERVICE}.entrypoints=web"
- "traefik.http.routers.${TRAEFIK_CONFIG_SERVICE}.rule=Host(`${TRAEFIK_CONFIG_HOST}`)"
- "traefik.http.routers.${TRAEFIK_CONFIG_SERVICE}.middlewares=${TRAEFIK_CONFIG_SERVICE}-https-redirect"
- "traefik.http.middlewares.${TRAEFIK_CONFIG_SERVICE}-https-redirect.redirectscheme.scheme=https"
- "traefik.http.routers.${TRAEFIK_CONFIG_SERVICE}-https-redirect.priority=0"