Traefik身份validation失败

这是我的目标,我想在我的服务器上build立一个反向代理。 我曾经使用Haproxy这个工作,但我想尝试Traefik。

首先,我想获得Traefik的仪表板页面。 它几乎奏效,popup窗口似乎进入我的凭据,但即使我确信证书是正确的,它总是失败。

这是我的traefik.toml

defaultEntryPoints = ["http", "https"] # Web section is for the dashboard interface [web] address = ":8080" [web.auth.basic] users = ["admin:aaa"] # entryPoints section configures the addresses that Traefik and the proxied containers can listen on [entryPoints] [entryPoints.http] address = ":80" [entryPoints.http.redirect] entryPoint = "https" [entryPoints.https] address = ":443" [entryPoints.https.tls] 

这是我的docker命令来运行容器

 docker run -d \ -v /var/run/docker.sock:/var/run/docker.sock \ -v $PWD/traefik.toml:/traefik.toml \ -v $PWD/acme.json:/acme.json \ -p 80:80 \ -p 443:443 \ -l traefik.frontend.rule=Host:monitor.firelabs.fr \ -l traefik.port=8080 \ --network proxy \ --name traefik \ traefik:1.3.6-alpine --docker --logLevel=DEBUG 

正如你可以看到我的凭据是admin:aaa,只要我尝试将它们input到对话框中,就会向我发送以下消息:

 time="2017-11-19T13:28:22Z" level=debug msg="Basic auth success..." 

正如你所看到的,只有开始与Traefik合作才是一个非常基本的configuration。 所以我不知道我在哪里错了,我看了关于networking部分configuration的文档,似乎没有错…

我错过了错字吗?

Traefik将密码存储为md5散列,而不是纯文本。 你可以使用htpasswd来产生这个:

 $ htpasswd -nb admin aaa admin:$apr1$DWU.kdcZ$iqwGcFl9bfwp1WfKHE2yl. 

所以你的traefik.toml文件看起来像这样:

 [web.auth.basic] users = "admin:$apr1$DWU.kdcZ$iqwGcFl9bfwp1WfKHE2yl."