traefik启动后默认会使用8080端口来监听dashboard访问,为了减少端口的暴露,可以使用80端口+路径来转发dashboard请求
1 2 3 4 5 6 7 8 9 10 11 12 13 14 |
# Dynamic Configuration http: routers: dashboard: rule: PathPrefix(`/dashboard`)) service: api@internal middlewares: - auth middlewares: auth: basicAuth: users: - "test:$apr1$H6uskkkW$IgXLP6ewTrSuBkTrqE8wj/" - "test2:$apr1$d9hr9HBB$4HxwgUir3HP4EsggP/QNo0" |
basicAuth的用户名密码可以通过https://hostingcanada.org/htpasswd-generator/生成