Docker-compose と Traefik を Let'sencrypt で使用して、cookiecutter-djangoを本番環境でテストしています。Django サイトを使用して、2 つのドメイン (mydomain1.com と mydomain2.com) で動作するように構成しようとしています。
必要なドメインにトラフィックを転送できるようにTraefikを構成する方法は?
これは私の traefik.toml です
logLevel = "INFO"
defaultEntryPoints = ["http", "https"]
# Entrypoints, http and https
[entryPoints]
# http should be redirected to https
[entryPoints.http]
address = ":80"
[entryPoints.http.redirect]
entryPoint = "https"
# https is the default
[entryPoints.https]
address = ":443"
[entryPoints.https.tls]
# Enable ACME (Let's Encrypt): automatic SSL
[acme]
# Email address used for registration
email = "mail@mydomain1.com"
storage = "/etc/traefik/acme/acme.json"
entryPoint = "https"
onDemand = false
OnHostRule = true
# Use a HTTP-01 acme challenge rather than TLS-SNI-01 challenge
[acme.httpChallenge]
entryPoint = "http"
[file]
[backends]
[backends.django]
[backends.django.servers.server1]
url = "http://django:5000"
[frontends]
[frontends.django]
backend = "django"
passHostHeader = true
[frontends.django.headers]
HostsProxyHeaders = ['X-CSRFToken']
[frontends.django.routes.dr1]
rule = "Host:mydomain1.com"
現在、すべてのドメインが ssl を介して動作していますが、mydomain1.com しか表示されず、mydomain2.com には ERR_TOO_MANY_REDIRECTS が表示されます。