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

[support] Match against multiple hosts #179

Closed
emil-nasso opened this issue Jan 30, 2016 · 3 comments · Fixed by #285
Closed

[support] Match against multiple hosts #179

emil-nasso opened this issue Jan 30, 2016 · 3 comments · Fixed by #285

Comments

@emil-nasso
Copy link

Is there any way to match against multiple different hosts for a frontend?

Here is an example. None of these hosts matches. If i remove on of them, the other matches.

[backends.example]
  [backends.example.servers.server1]
  url = "http://127.0.0.1:10082"

[frontends.example]
backend = "example"
  [frontends.example.routes.test_1]
  rule="Host"
  value="example.test.se"
  [frontends.example.routes.test_2]
  rule="Host"
  value="example.nu"

Looking at the web interface, it looks like it should work.

https://dl.dropboxusercontent.com/s/adonv8fw5g658t6/2016-01-30%20at%2020.56%202x.png?dl=0

But when i open the page in a browser i get a 404.

This can be solved by adding another frontend for the same backend. Would still be interested in how you would do it with one frontend though.

@emilevauge
Copy link
Member

Hi @emil-nasso, for now, there is a AND operator between rules of a frontend (not a OR).
A workaround to solve your issue is to create multiple frontends for now:

[backends.example]
  [backends.example.servers.server1]
  url = "http://127.0.0.1:10082"

[frontends.exampletest]
backend = "example"
  [frontends.exampletest.routes.test]
  rule="Host"
  value="example.test.se"
[frontends.examplenu]
backend = "example"
  [frontends.examplenu.routes.test]
  rule="Host"
  value="example.nu"

But, as I said in #116:

I'm planning to modify the behavior of routes, now there is a AND operation between routes from a frontend, and I think it would be more useful to have a OR. WDYT?

@emilevauge
Copy link
Member

Duplicate #116

@emil-nasso
Copy link
Author

@emilevauge Yeah. That sounds great. Maybe a configuration flag on the frontend where you can set "match: all" or "match: any"? Where all is and and any is or. It would be great to be able to tweak it. It could default to "match: all" to not break and backwards compatibility.

@emilevauge emilevauge mentioned this issue Apr 6, 2016
2 tasks
@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

Successfully merging a pull request may close this issue.

3 participants