feat: Simplify traefik rules

This commit is contained in:
Simon 2020-04-09 11:11:36 +02:00
parent 6c62b1e1fe
commit d2a2fac03f
1 changed files with 6 additions and 16 deletions

View File

@ -46,25 +46,15 @@ services:
labels:
traefik.enable: "true"
# Redirect http:// to https://
traefik.http.routers.histoiredunpied.rule: "Host(`${URL}`)"
traefik.http.routers.histoiredunpied.entrypoints: "web"
traefik.http.routers.histoiredunpied.middlewares: "redirect-https@docker"
traefik.http.routers.histoiredunpied-https.rule: "Host(`${URL}`)"
traefik.http.routers.histoiredunpied-https.entrypoints: "websecure"
traefik.http.routers.histoiredunpied-https.tls.certResolver: "letsencrypt"
# Redirect http://www to https://
traefik.http.routers.histoiredunpied-redirect-www.rule: "Host(`www.${URL}`)"
traefik.http.routers.histoiredunpied-redirect-www.entrypoints: "web"
traefik.http.routers.histoiredunpied-redirect-www.middlewares: "redirect-www@docker"
traefik.http.routers.histoiredunpied.entrypoints: "websecure"
traefik.http.routers.histoiredunpied.tls.certResolver: "letsencrypt"
# Redirect https://www to https://
traefik.http.routers.histoiredunpied-redirect-www-https.rule: "Host(`www.${URL}`)"
traefik.http.routers.histoiredunpied-redirect-www-https.entrypoints: "websecure"
traefik.http.routers.histoiredunpied-redirect-www-https.tls.certResolver: "letsencrypt"
traefik.http.routers.histoiredunpied-redirect-www-https.middlewares: "redirect-www@docker"
traefik.http.routers.histoiredunpied-redirect-www.rule: "Host(`www.${URL}`)"
traefik.http.routers.histoiredunpied-redirect-www.entrypoints: "websecure"
traefik.http.routers.histoiredunpied-redirect-www.tls.certResolver: "letsencrypt"
traefik.http.routers.histoiredunpied-redirect-www.middlewares: "redirect-www@docker"
com.centurylinklabs.watchtower.enable: true
networks: