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

Priortities in 1.0.0 not behaving #506

Closed
bluecmd opened this issue Jul 10, 2016 · 4 comments
Closed

Priortities in 1.0.0 not behaving #506

bluecmd opened this issue Jul 10, 2016 · 4 comments

Comments

@bluecmd
Copy link

bluecmd commented Jul 10, 2016

Hi,

I have this frontend config:

  # Special endpoint for traefik mgmt (authed)
  [frontends.mgmt]
  backend = "mgmt"
  priority = 100
  entrypoints = ["authed"]
    [frontends.mgmt.routes.main]
    rule = "Host: traefik.cloud.mydomain.tld"

  # Entry for our cloud services (authed)
  [frontends.cloud]
  backend = "nginx"
  priority = 10
  entrypoints = ["authed"]
    [frontends.cloud.routes.main]
    rule = "HostRegexp: {subdomain:.+}.cloud.mydomain.tld"

To me this means that traefik.cloud.mydomain.tld should go to "mgmt" backend and that rest of the *.cloud.mydomain.tld domains should go to "nginx". This however is not the case. Whatever I try I always get passed to "nginx". Removing the "frontends.cloud" block makes "frontends.mgmt" work the way I want, so I'm guessing it's something related to priorities.

I tried switching the order (that's not very well documented btw, does "100" come before "10"?) and even have only "frontends.mgmt" have the priority, but to no avail.

@emilevauge
Copy link
Member

emilevauge commented Jul 11, 2016

@bluecmd that's weird, priorities are working on my laptop...
Which version of traefik are you using?

@bluecmd
Copy link
Author

bluecmd commented Jul 11, 2016

@emilevauge
Copy link
Member

emilevauge commented Jul 19, 2016

OK I tested using a similar configuration and I confirm that it behaves as expected.

  [frontends]
    [frontends.frontend1]
    backend = "backend1"
    priority = 100
    passHostHeader = true
      [frontends.frontend1.routes.test_1]
      rule = "Host:test.docker.localhost"
    [frontends.frontend2]
    priority = 1000
    backend = "backend2"
    passHostHeader = true
      [frontends.frontend2.routes.test_1]
      rule = "HostRegexp:{subdomain:.+}.docker.localhost"

Both curl http://test2.docker.localhost:8001 and curl http://test.docker.localhost:8001 go on backend2.

  [frontends]
    [frontends.frontend1]
    backend = "backend1"
    priority = 100
    passHostHeader = true
      [frontends.frontend1.routes.test_1]
      rule = "Host:test.docker.localhost"
    [frontends.frontend2]
    priority = 10
    backend = "backend2"
    passHostHeader = true
      [frontends.frontend2.routes.test_1]
      rule = "HostRegexp:{subdomain:.+}.docker.localhost"

curl http://test2.docker.localhost:8001 goes on backend2 and curl http://test.docker.localhost:8001 goes on backend1.

@bluecmd
Copy link
Author

bluecmd commented Jul 19, 2016

Odd. Thanks for testing it out. I'll re-open if it still doesn't work for me.

@bluecmd bluecmd closed this as completed Jul 19, 2016
@traefik traefik locked and limited conversation to collaborators Sep 1, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

4 participants