Matching arbitrary levels of wildcard domains

I thought *.example.com would have matched foo.bar.example.com but it seems it only matches one level of subdomains down, e.g. foo.example.com works but foo.bar.example.com says “No such site at :80”

Is there a way to match an arbitrary number of subdomains?

edit: after researching a bit more i found that i can fake it by adding *.*.example.com, *.*.*.example.com, etc… but i’d like a solution that works for any number of levels

How many levels do you have?? (honest question, because if it’s less than, say, 10 or 20 or 50, you can probably just list them in the Caddyfile)

It is the way that it is to match certain RFC specs.

yeah I realised after I first posted that I can manually list every level I want but, that’s super inconvenient, and I’d like virtually infinite levels if possible

What’s your use case? I’m wondering what would necessitate “virtually infinite levels” of subdomains.

My use case is letting users reserve their own subdomains, and users reserving absurdly long domain names for jokes, like according.to.all.known.laws.of.aviation.there.is.no.way.a.bee.should.be.able.to.fly.its.wings.are.too.small.to.get.its.fat.little.body.off.the.ground.the.bee.of.course.flies.anyway.because.bees.don.t.care.what.humans.think.is.impossible.example.com

3 Likes

:grinning: * 代表的是泛前缀,是应该有无限级的:wink:

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.