When I try to negate Host matcher in router with "!" operator (which is documented here Traefik Routers Documentation - Traefik "Invert a matcher") i get an error:
"error while parsing rule ! is not supported"
My rule is:
traefik.http.routers.my-host-traefik.rule=HostRegexp(
{subdomain:.+}.my.host) && ! Host(
traefik.my.host)
Traefik version 2.5.6
What i doing wrong?
The error might come from elsewhere.
It works fine with me with this configuration:
version: '3.6'
services:
traefik:
image: traefik:v2.6
command:
- --providers.docker
ports:
- "80:80"
volumes:
- /var/run/docker.sock:/var/run/docker.sock
whoami:
image: traefik/whoami # https://github.com/traefik/whoami
labels:
traefik.http.routers.whoami.rule: '!Host(`whoami.localhost`) && PathPrefix(`/`)'
Thanx for testing. I realized whats wrong, I have another one traefik, but version 2.2.0 which is not supports "!" operator 