You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
featureA new featuregood first issueShould be pretty easy to dohelp wantedNot actively being worked on. If you plan to contribute, please drop a note.medium effortLikely a few days of development effort
Support routes that match wildcard sub-domains such as *.domain.example.com (and fix existing bugs in the process -- more on this below :))
Motivation for New Feature
ReRoute.UpstreamHost uses ordinal string comparison and does not support wildcards.
Implementation note
For reference, here's what Nginx supports (look under the Wildcard names section in particular). My suggestion that seems to align with Nginx ideas:
Parse the host header to extract the host and optional port. There is currently a bug in Ocelot where if the Host header is Host: example.com:123 it will not match a route with UpstreamHost example.com, which IMHO it obviously should
If there's a trailing dot in the incoming host name, remove it (i.e. example.com and example.com. should be treated the same)
UpstreamHost = "*.example.com" would be matched with regex ^[a-z0-9.-]+\.example\.com$
UpstreamHost = ".example.com" would be matched with regex ^(?:[a-z0-9.-]+\.)?example\.com$
(4) is nice because it is fairly common for a service to want to take over a domain and all of its subdomains, and it offers an easy way to do that with a single route.
I'll start working on this and will send a PR soon (maybe tomorrow). Let me know if you have any concerns or suggestions.
Reacted by billhong-moneydj, Chris Jennings and singha
@davidni awesome this all sounds good to me, with PR lets just make sure there are tests for all the functionality you are going to add :D If you can be bothered updating the docs with all of this would also be awesome but I can do that if you dont want to! Really appreciate your contributions.
@TomPallister quick update since it's been a while. I haven't given up on this issue, but priorities changed a bit and I haven't been able to get to it. I still want to get to it asap, but there's other stuff on the way.
As a side note, I'm very happy with the 10.* release and that so many dependencies are gone. Makes it a lot easier for us to consume! Thanks and keep it up.
@davidni all good! I'm going to take out everything from Ocelot apart from FluentValidation and see where things are. I want to try and make the whole thing more extensible so people can spin up their own packages to get stuff done / maybe override Ocelot's default behaviour.
I'll start working on this and will send a PR soon (maybe tomorrow). Let me know if you have any concerns or suggestions.
Hello Mr. David!
I would be happy if you let us know your plans on delivery a PR for review!
Do you have an intention to contribute?
Pay attention you've discussed 8th version with Tom, and nowadays we have 19th version for .NET 7.
A bit different product, right?
I guess your wildcard idea for upstream hosts is still actual.
@TomPallister
This is so nice! 🤣 5 years! 🎉
I believe the issue shows good idea. But user scenario is still unclear for me. I don't understand why we need to merge all subdomains into one super route definition. Would not it be risky?
It is dilemma:
we have one super route which processes all subdomains traffic
we will split and register multiple subdomains routes using dynamic routes feature in Service Discovery area
featureA new featuregood first issueShould be pretty easy to dohelp wantedNot actively being worked on. If you plan to contribute, please drop a note.medium effortLikely a few days of development effort
Activity
TomPallister commentedon Jul 19, 2018
@davidni awesome this all sounds good to me, with PR lets just make sure there are tests for all the functionality you are going to add :D If you can be bothered updating the docs with all of this would also be awesome but I can do that if you dont want to! Really appreciate your contributions.
davidni commentedon Aug 17, 2018
@TomPallister quick update since it's been a while. I haven't given up on this issue, but priorities changed a bit and I haven't been able to get to it. I still want to get to it asap, but there's other stuff on the way.
As a side note, I'm very happy with the 10.* release and that so many dependencies are gone. Makes it a lot easier for us to consume! Thanks and keep it up.
TomPallister commentedon Aug 17, 2018
@davidni all good! I'm going to take out everything from Ocelot apart from FluentValidation and see where things are. I want to try and make the whole thing more extensible so people can spin up their own packages to get stuff done / maybe override Ocelot's default behaviour.
rafaelcaviquioli commentedon Apr 23, 2019
I need wildcards to work with multiple staging environments
raman-m commentedon Jul 13, 2023
@davidni commented on Jul 19, 2018:
Hello Mr. David!
I would be happy if you let us know your plans on delivery a PR for review!
Do you have an intention to contribute?
Pay attention you've discussed 8th version with Tom, and nowadays we have 19th version for .NET 7.
A bit different product, right?
I guess your wildcard idea for upstream hosts is still actual.
@TomPallister
This is so nice! 🤣 5 years! 🎉
I believe the issue shows good idea. But user scenario is still unclear for me. I don't understand why we need to merge all subdomains into one super route definition. Would not it be risky?
It is dilemma:
What do you think?
raman-m commentedon Nov 29, 2023
@davidni Hi Hi Mr. David!
Where is your PR, Mr. David?
We are waiting your PR so much!
Why not to use just Nginx proxy with this functionality? 😉
Ah, got it... You had just idea... and nothing more! 🤣
Converting to Idea discussion...