Redirectscheme.scheme=https vs headers.sslredirect=true

I find confusing that there are 2 options:

  1. traefik.http.middlewares.force-https.redirectscheme.scheme=https
  2. traefik.http.middlewares.force-https.headers.sslredirect=true

Which one is better? Are those equivalent?

FTR explains how and why to configure global HTTP2HTTPS redirection. But doesn't clarify which option is better.


the problem is the same in Traefik v1:

As the v1 documentation was a bit confusing by it-self, maybe you haven't see that before.

We recommend to use the redirectscheme middleware.

the headers.sslredirect is an option that comes from an external dependency that we use, and this option is weak and can have side effects.