这是我的目标,我想在我的服务器上设置反向代理 . 我曾经使用Haproxy做这项工作,但我想尝试Traefik .
首先,我想获得Traefik的仪表板页面 . 它几乎可以工作,弹出窗口似乎输入我的凭据但它总是失败,即使我确信凭据是正确的 .
这是我的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,每当我尝试将它们输入对话框时,它都会向我发送以下消息:
time="2017-11-19T13:28:22Z" level=debug msg="Basic auth success..."
正如您所看到的,这是一个非常基本的配置,只是为了开始与Traefik合作 . 所以我不知道我哪里错了,我看了关于网页部分配置的文档,它似乎没有错...
我错过了错字吗?
1 回答
Traefik将密码存储为md5哈希,而不是纯文本 . 你可以使用htpasswd来生成这个:
所以你的traefik.toml文件看起来像: