I honestly don't understand this from the documentation: HostRegexp(traefik.io, {subdomain:[a-z]+}.traefik.io, ...)
Is "subdomain" part of the string? like, what's going on? It would be awesome if the documentation was clearer.
(oh and, the "tags" still don't make any sense. This question isn't really specific to kubernetes-ingress)
I did not check that with v2, but if that something has not changed from v1 then subdomain is just an arbitrary string that has no bearing on how the expression parsed. It has to be present, but its content can be anything. I understand this is because how regexp engine used behind the scenes wants it. It also confused me when I came across this for the first time.
Sorry to bring this up, but I'm also struggling with this.
Not because of the regex definition, but because of the variable scope.
In v1 I was using the variable defined in HostRegexp with an addprefix
While migrating to v2, it doesn't look to work anymore, as if the variable defined in the regex was out of scope for the middleware.
#V2 not working
- traefik.http.routers.sf14.rule=HostRegexp(`{subdomain:[a-z0-9]+}.${HOSTNAME}`)
- traefik.http.middlewares.sf14-addprefix.addprefix.prefix={subdomain}
- traefik.http.routers.sf14.middlewares=sf14-addprefix@docker
I lookup for variable usage but did only find stuff about environnement variables.
Is it still achievable in v2 and what is the scope of a variable defined in a HostRegexp rule ?
You're perfectly right, I just re-tested this misleading configuration and it did not work.
That's why "dead code" is worst than anything...
Sorry for the bad dump.