2018-03-31 23:57



I have two apps running on marathon.
I want to route to App 1, and to route to app2.

With the below config, all traffic is going to app 1.

App 1  

App 2;PathPrefix:/app

I tried using negative matching to exclude /app routing for app 1, but it is my understanding that negative lookahead isn't fully supported in golang and by result also not in traefik.

I also tried specifying a path prefix for app 1 like so;PathPrefix:/ but this has no effect.

When I modify the rule for App 1 to point to all traffic goes to app 2 correctly, From that I conclude that the routing config to App 2 is correct, it is just being ignored because App 1 supersedes it since it also satisfies the route.

This issue is discussing this exact use case:

But it looks like a config without pathPrefix takes precedence over a config with pathPrefix, maybe this type of config is simply not supported on the marathon backend ?

It's not clear to me from this documentation:

Looking for an answer that will help me understand whether this use case is supported at all on the marathon backend, or an example working config for it.

Using Traefik v1.5.1

  • 点赞
  • 写回答
  • 关注问题
  • 收藏
  • 复制链接分享
  • 邀请回答


  • doudi2431 doudi2431 3年前

    If multiple rules match traefic will use the length of the rule to determine which rule is most specific instead of the actual specificity. You can override this artificial priority by using


    More info:

    点赞 评论 复制链接分享
  • douzhanhui5662 douzhanhui5662 3年前

    If I adjust the rule for app 1 to;PathPrefix:/

    per one of your attempts, and stick with;PathPrefix:/app

    on app 2, the routing behavior seems to be as expected: Requests with the host and an /app path go to app 2 exclusively and deterministically (because Traefik employs longest-path matching). If I modify the request to use the root path / (or any path other than /app as they will all hold the matching root path prefix), traffic is forwarded to app 1.

    I tested against Marathon 1.3.10.

    点赞 评论 复制链接分享