Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add routes priorities #433

Merged
merged 5 commits into from
Jun 7, 2016
Merged

Add routes priorities #433

merged 5 commits into from
Jun 7, 2016

Conversation

emilevauge
Copy link
Member

@emilevauge emilevauge commented Jun 3, 2016

This PR adds routes priorities to avoid path overlap.
By default, routes will be sorted using rules length:
PathPrefix:/12345 > PathPrefix:/1234 > PathPrefix:/1
You can customize priority by frontend:

  [backends]
    [backends.backend1]
      [backends.backend1.LoadBalancer]
        method = "wrr"
      [backends.backend1.servers.server1]
      url = "http://172.17.0.2"
      weight = 1
    [backends.backend2]
      [backends.backend2.LoadBalancer]
        method = "wrr"
      [backends.backend2.servers.server1]
      url = "http://172.17.0.3"
      weight = 1

  [frontends]
    [frontends.frontend1]
    backend = "backend1"
    priority = 10
    passHostHeader = true
      [frontends.frontend1.routes.test_1]
      rule = "PathPrefix:/to"
    [frontends.frontend2]
    priority = 5
    backend = "backend2"
    passHostHeader = true
      [frontends.frontend2.routes.test_1]
      rule = "PathPrefix:/toto"
  • code
  • tests
  • doc

Fixes #298

Signed-off-by: Emile Vauge [email protected]

@vdemeester
Copy link
Contributor

LGTM 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Sort routes' Paths by length to avoid overlap
3 participants