Welcome to JiKe DevOps Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
612 views
in Technique[技术] by (71.8m points)

docker - Traefik 2 Dashboard Custom Context Path

I would like to change the context path for the Traefik dashboard from e.g. https://apps.example.com/ to https://apps.example.com/traefik, as I have Heimdall routed to https://apps.example.com/. All the examples I could find are for Traefik 1.x. What would be the easiest way to do this? My current config (which doesn't work):

traefik.toml:

[entryPoints]
  [entryPoints.web]
    address = ":80"
    [entryPoints.web.http.redirections.entryPoint]
      to = "websecure"
      scheme = "https"

  [entryPoints.websecure]
    address = ":443"

[api]
  dashboard = true
  insecure = true

[log]
  level = "DEBUG"

[certificatesResolvers.cloudflare.acme]
  email = "email@email.com"
  storage = "acme.json"
  [certificatesResolvers.cloudflare.acme.dnsChallenge]
    provider = "cloudflare"
    resolvers = ["1.1.1.1:53", "8.8.8.8:53"]

[providers.docker]
  watch = true
  network = "web"
  exposedByDefault = false
  endpoint = "unix:///var/run/docker.sock"

[providers.file]
  filename = "traefik_dynamic.toml"

traefik_dynami.toml:

[http.routers.api]
  rule = "Host(`apps.example.com`) && Path(`/traefik`)"
  entrypoints = ["websecure"]
  service = "api@internal"
  [http.routers.api.tls]
    certResolver = "cloudflare"

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

Please log in or register to answer this question.

1 Answer

0 votes
by (71.8m points)
等待大神答复

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to JiKe DevOps Community for programmer and developer-Open, Learning and Share
...