0

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?

1
  • Okay, I put rules instead of rule since there was more than one condition. That was it. Dumb me.
    – Gerald
    Commented Jun 3, 2023 at 23:28

1 Answer 1

0

I put rules instead of rule since there was more than one condition. That was it. All working now.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.