Merge pull request #5999 from caplod/traefik-https-redirect
fix redirect from http to https
This commit is contained in:
@@ -7,6 +7,8 @@ services:
|
|||||||
command:
|
command:
|
||||||
- --entrypoints.http.address=:80
|
- --entrypoints.http.address=:80
|
||||||
{{ if $.TRAEFIK_LETSENCRYPT_EMAIL }}
|
{{ if $.TRAEFIK_LETSENCRYPT_EMAIL }}
|
||||||
|
- --entrypoints.http.http.redirections.entrypoint.to=https
|
||||||
|
- --entrypoints.http.http.redirections.entrypoint.scheme=https
|
||||||
- --entrypoints.https.address=:443
|
- --entrypoints.https.address=:443
|
||||||
{{ end }}
|
{{ end }}
|
||||||
- --providers.docker
|
- --providers.docker
|
||||||
@@ -38,14 +40,6 @@ services:
|
|||||||
|
|
||||||
{{ if $.TRAEFIK_LETSENCRYPT_EMAIL }}
|
{{ if $.TRAEFIK_LETSENCRYPT_EMAIL }}
|
||||||
- "traefik.http.routers.api.tls.certresolver=leresolver"
|
- "traefik.http.routers.api.tls.certresolver=leresolver"
|
||||||
|
|
||||||
# global redirect to https
|
|
||||||
- "traefik.http.routers.http-catchall.rule=hostregexp(`{host:.+}`)"
|
|
||||||
- "traefik.http.routers.http-catchall.entrypoints=http"
|
|
||||||
- "traefik.http.routers.http-catchall.middlewares=redirect-to-https"
|
|
||||||
|
|
||||||
# middleware redirect
|
|
||||||
- "traefik.http.middlewares.redirect-to-https.redirectscheme.scheme=https"
|
|
||||||
{{ end }}
|
{{ end }}
|
||||||
|
|
||||||
network_mode: bridge
|
network_mode: bridge
|
||||||
|
|||||||
Reference in New Issue
Block a user