Define host and path frontend rule for Traefik

后端 未结 1 658
你的背包
你的背包 2021-02-20 00:36

I am trying to use Traefik to deploy proxy multiple applications in my Docker Swarm mode cluster.

I have got it so that it proxies a named Host but I want it to proxy o

1条回答
  •  旧时难觅i
    2021-02-20 01:03

    Traefik v1

    If you want multiple rules to apply in order for a routing decision to become effective, separate them by semicolon. For instance:

    Host: ; PathPrefixStrip: /portainer
    

    What the above means is: If the host and path prefix match, Traefik will route requests to the associated backend(s) (and strip off the specified path prefix prior to forwarding). This even works when defined inside a label.

    See the frontend documentation for details.

    Update: Traefik v2

    Host(`domain.com`) && Path(`/path`)
    

    See the docs

    0 讨论(0)
提交回复
热议问题