I can run without a problem for example https://dev.domain.co/ and it takes /home/domain/stages/. Since SSL is hard to have double subdomain, like on http (for example: dev.user.domain.co) you have to use hack like (https://dev-user.domain.co) to use wildcard SSL.
Is it possible to parse this dash and have served folder /home/domain/|user|/stages/|dev|. Or is there any other smart solution on this problem i dont see?
** also a hint, I used 2 days to find this placeholder {http.request.host.labels.2}, it should be mentioned here root (Caddyfile directive) — Caddy Documentation, because a lot of people are looking for wildcard solution. Just an idea.
4. Error messages and/or full log output:
5. What I already tried:
everything possible, checked docs for last 3 days, but couldnt find anything.
Due to the way browsers handle certificates nowadays(requirement for Subject Alternative Name for every single sub-domain), wildcard certificate kind of lost its purpose.
It’ll be imperceptible. The regexp is compiled ahead of time, so most of the cost is offloaded to server startup. It’s not as fast as substring matches, but it’s also not slow, per se. This is a pretty simple regexp ultimately, since there’s no lookaheads or lookbehinds or anything like that, so it shouldn’t be a problem.
Also you shouldn’t worry about premature optimization. You should only care that it’s slow if your server is totally getting flooded all the time, and you just can’t scale up with a bigger server, or scale out with more Caddy instances. You’ll hit other bottlenecks much earlier than this regexp.