Traefik redirect

Hello,

  whoami:
    image: containous/whoami
    labels:
      traefik.enable: true

      traefik.http.routers.whoami.rule: Host(`whoami.localhost`, `www.whoami.localhost`)
      traefik.http.routers.whoami.entrypoints: web
      traefik.http.routers.whoami.middlewares: trim_www

      # middleware: http://www. to  http://
      traefik.http.middlewares.trim_www.redirectregex.regex: ^http://www\.(.+)
      traefik.http.middlewares.trim_www.redirectregex.replacement: http://$${1}
      traefik.http.middlewares.trim_www.redirectregex.permanent: true

For a more global approach: