In Traefik2, I've got router.toml
that contains the following lines:
[http.routers]
[http.routers.sonarr-bypass]
rules = "Host(`sonarr.DOMAIN.com`) && Headers(`traefik-auth-bypass-key`, `thekey`)"
middleware = ["chain-no-auth"]
service = "sonarr"
[http.routers.sonarr-bypass.tls]
[http.routers.sonarr]
rule = "Host(`sonarr.DOMAIN.com`)"
middlewares = ["chain-oauth"]
service = "sonarr"
[http.routers.sonarr.tls]
[http.services]
[http.services.sonarr.loadBalancer]
[[http.services.sonarr.loadBalancer.servers]]
url = "http://192.168.50.51:8989"
The chain-no-auth
and chain-oauth
middlewares work elsewhere, like in my docker-compose.yml
, but the above sends me to my OAuth server regardless of my headers when accessing the URL sonarr.DOMAIN.com
.
Am I missing something? Perhaps I need to set the priority?
rules
instead ofrule
since there was more than one condition. That was it. Dumb me.