First of all, thank you for the traefik. It is awesome.
Currently, I am replacing nginx with traefik as a reverse proxy. It works seamlessly but when I added the redirectScheme
middleware It caused an infinite loop and also the ALB health checks also starts to fails. BTW I am using ECS for deployment.
I am no expert in Networking stuff. So please, anyone has any idea how to solve this problem please do let me know.
Flow:
Request ---> ALB ---> Traefik ---> API
Below are my configuration.
traefik.yaml
accessLog: {}
log:
level: INFO
format: json
providers:
docker:
endpoint: unix:///var/run/docker.sock
exposedByDefault: false
file:
directory: /etc/traefik/providers
file.provider.yaml
http:
middlewares:
https-only:
redirectScheme:
scheme: https
permanent: true
task-definition.json
{
"containerDefinitions": [
{
"name": "backend",
"hostname": "backend",
"dockerLabels": {
"traefik.enable": "true",
"traefik.http.routers.backend.rule": "PathPrefix(`/`)",
"traefik.http.routers.backend.middlewares": "for-dev@file"
}
},
{
"name": "proxy",
"hostname": "proxy",
"portMappings": [
{
"hostPort": 80,
"containerPort": 80
}
],
"links": ["backend"],
"mountPoints": [
{
"sourceVolume": "docker-socket",
"containerPath": "/var/run/docker.sock"
}
]
}
],
"volumes": [
{
"name": "docker-socket",
"host": {
"sourcePath": "/var/run/docker.sock"
}
}
]
}