跳至主要內容

Traefik路由配置示例

yhma小于 1 分钟Traefik

http:
  # Add the router
  routers:
    my-router:
      entryPoints:
        - web
      middlewares:
        - my-stripprefix
        - my-traefik-timer-plugin
      service: my-service
      rule: PathPrefix(`/`)

  # Add the middleware
  middlewares:
    my-stripprefix:
      stripPrefix:
        prefixes:
          - "/"
    my-traefik-timer-plugin:
      plugin:
        traefik-timer-plugin:
          log: "true"
  # Add the service
  services:
    my-service:
      loadBalancer:
        servers:
          - url: http://localhost:8080/