如何为每个前端指定基本身份验证

时间:2018-01-06 16:37:26

标签: traefik

阅读提及traefik.frontend.auth.basic的{​​{3}}和https://github.com/containous/traefik/issues/751我试图为每个traefik前端设置基本身份验证(不是入口点)。

无论

[frontends.kibana]
backend = "kibana"
    [frontends.kibana.routes.nas]
    rule = "Host:kibana.mydomain.io"
    [frontends.kibana.auth]
    basic = "kibana:$apr1$cHAIJt0o$..."

也不是

[frontends.kibana]
backend = "kibana"
auth.basic = "kibana:$apr1$cHAIJt0o$..."
    [frontends.kibana.routes.nas]
    rule = "Host:kibana.mydomain.io"

正在运作。如何在前端级别指定基本身份验证?

1 个答案:

答案 0 :(得分:4)

就像那样:

[frontends.kibana]
  backend = "kibana"
  basicAuth = ["kibana:$apr1...", "anabik:$apr1..."]
  [frontends.kibana.routes.nas]
    rule = "Host:kibana.mydomain.io"