HTTPS-Redirect with Traefik behind Aws Loadbalancer

那年仲夏 提交于 2019-12-02 01:26:11

After a deeper research, i found the solution myself.

The problem was a missing label on the application Container, after i added

- "traefik.frontend.headers.SSLProxyHeaders=X-Forwarded-Proto: https"
- "traefik.frontend.headers.SSLRedirect=true"

on my application containers it worked like a charm with a clear 301 redirect.

Why the need of the header, in default the aws-elb takes a https request and forwards it with a HTTP(80) to the connected Instance, during this process the elb adds the X-Forwarded-Proto: https Header to the request.

Since traefik doesn't know that it is running behind an elb it does the redirect over and over again. But the Header stops this behavior.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!