Matching arbitrary levels of wildcard domains

I thought * would have matched but it seems it only matches one level of subdomains down, e.g. works but 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 *.*, *.*.*, 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


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

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