首页 > 解决方案 > 路径的 Traefik basicauth

问题描述

我希望 basicauth 仅适用于 /admin 路径:

    labels:
      - "traefik.http.routers.app.rule=Host(`host.com`)"
      - "traefik.http.routers.app.tls=true"
      - "traefik.http.middlewares.app_auth.basicauth.usersfile=/etc/traefik/basicauth"
      - "traefik.http.routers.app_admin.rule=Host(`host.com`) && Path(`/admin`)"
      - "traefik.http.routers.app_admin.middlewares=app_auth"
      ...

这是配置不起作用。我错过了什么?

标签: traefik

解决方案


推荐阅读