How to redirect an HTTPS request based on a header value?

Hi y'all!
I have a docker service behind traefik; due to its nature we're being pretty stingy with TLS, and so the minVersion is set to VersionTLS12, which obviously breaks every version of IE.

Since this service is sometimes used by people who still have IE on their computers - how may I redirect them to an appropriate error page (or whatever)? Because, if I just leave this as-is - the browser's default error message is pretty misleading:

It makes it look like the service is down, while in reality it is not.

Now: this is my config file:

  checkNewVersion = false

  dashboard = true

  level = "DEBUG"


    address = ":80"
    address = ":443"

    exposedByDefault = false
    directory = "/etc/dynamic-config/"

      email = "redacted@redact.ed"
      storage = "/etc/acme.json"
      entryPoint = "http"

This is a file I load as a dynamic provider:

    sniStrict = true
    minVersion = "VersionTLS12"
    cipherSuites = [

    rule = "HostRegexp(``, `{subdomain:.+}`) && HeadersRegexp(`User-Agent`, `.*MSIE.*`)"
    priority = 9000000
    entryPoints = ["https"]
    service = "my-service"

      url = ""


  • These settings work if I only specify the "http" entrypoint. But it makes no sense for my usecase, as I only need to redirect the HTTPS requests from browsers which can not set up a connection.
  • With the "https" entrypoint it doesn't redirect, because it probably tries to initialize SSL before trying to redirect the request. Which is why I'm posting here :sweat_smile:
  • I know that S3 url won't work like that, I'll figure out a better service destination. It's a temp value.

Ok, so given that the average level of activity on this forum asymptotically approaches zero and I hate seeing unanswered forum threads - here comes my solution.

The above is a tricky instance of a stupid problem in disguise. To understand why, here's two diagrams:

standard connection flow:
client -> traefik -> application server -> traefik -> client

HTTP inside traefik:
------> request received from an entry point -> headers read -> router rules applied -> off to a service ------> return response to the client

HTTPS inside traefik:
------> request received from an entry point -> DECRYPTION -> headers read -> router rules applied -> off to a service -> receive response -> ENCRYPTION -------> return response to the client?

My setup obviously works with HTTP because there's no encryption involved - it just redirects the thing where I ask it to. But when I need to do that with the HTTPS - it'd need to decrypt it first, so it's pretty obvious that it can not redirect the request before reading its headers. And in order to decrypt the communication - it'd need to set up TLS first, which is broken client-side.

So, it is literally not possible to set up a redirect for "all the clients that are broken" - or even single them out as a category. Putting up an error message that is informative enough to the end users is entirely a responsibility of the browser at the hand.