From 49f40a4128ac2e09e194b0579de080ec32e6ab6e Mon Sep 17 00:00:00 2001 From: Simon C Date: Wed, 11 Mar 2020 16:20:33 +0100 Subject: [PATCH] feat: Remove www --- docker-compose.yml | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/docker-compose.yml b/docker-compose.yml index ca0be8b..c3814d1 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -10,13 +10,27 @@ services: labels: traefik.enable: "true" traefik.docker.network: "traefik" + + # 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" + + # 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" + networks: default: external: