I am configuring traefik as a router for AWS ECS. What is happening is that if I open the domain traefik.example.com
it opens up dashboard even though I have not added any rules for this domain. When I try to open beta.example.com
and have also added docker labels to a service with traefik.frontend.rule=Host:beta.example.com
to the service this needs to be forwarded , I am being redirected to beta.example.com/dashboard/
and again the dashboard for traefik shows up. If I provide any endpoint to the url, it works like beta.example.com/home
this works perfectly fine and opens the home page for beta.example.com
. For some reason the domain beta.example.com
is not working as it is not being forwarded to the service which has the rules.
My traefik toml file is
debug = true
logLevel = "DEBUG"
defaultEntryPoints = ["http"]
[entryPoints]
[entryPoints.http]
address = ":6060"
[traefikLog]
filePath = "/var/log/process.log"
format = "json"
[accessLog]
filePath = "/var/log/traefik.log"
format = "json"
[accessLog.fields.headers]
defaultMode = "keep"
[api]
entryPoint = "http"
dashboard = true
[ping]
entryPoint = "http"
# Enable ECS Provider.
[ecs]
clusters = ["ExampleECS"]
watch = true
domain = "example.com"
autoDiscoverClusters = false
refreshSeconds = 15
exposedByDefault = false
region = "eu-west-1"
accessKeyID = "XXXXXXXXXX"
secretAccessKey = "XXXXXXXXXXXXXXXXXXXXXXXXX"
The Labels I have defined on the docker container are in the Task Definition in ECS are
"dockerLabels": {
"traefik.frontend.rule": "Host:beta.example.com",
"traefik.enable": "true",
"traefik.protocol": "http",
"traefik.backend.loadbalancer.method": "wrr",
"traefik.backend.loadbalancer.stickiness": "true",
"traefik.backend.loadbalancer.stickiness.cookieName": "true",
"traefik.frontend.protocol": "http",
"traefik.port": "9050",
"traefik.domain": "example.com",
"traefik.frontend.passHostHeader": "true",
"traefik.frontend.entryPoints": "http"
},
I am unable to figure out why beta.example.com
is not opening the beta app.
My Traefik is behind an AWS ALB in a target group. I have set proper rules on the ALB as the traffic is being forwarded to Traefik.
Can someone explain to me as to why this is happening.
Regards,
M.