Global Plugin Precedence

Just a clarification on Plugin Precedence.

I want to have a global plugin for the Authentication but I want to disable for the health checks
So I have a service dedicated for the health checks and at the route level I set the plugin AUTH to false.

When I try to reach that /monitoring I see an 401.

_format_version: “1.1”
_comment: “Global Plugins”
plugins:

  • name: AUTH
    config:

    enabled: true
    services:
  • name: public.api
    url: http://localhost:9103/
    protocol:
    • http
      routes:
    • name: monitoring.health.checks
      strip_path: false
      tags: [monitoring,health-checks]
      paths:
      • /monitoring/
        protocols:
      • http
        methods:
      • GET
        plugins:
        • name: AUTH
          enabled: false

Is not possible do this things?

No.
Global plugin will be always executed.

1 Like

Hi @hbagdi,

It’s true your afirmation of that global plugin will be always executed? In the precedence doc (https://docs.konghq.com/2.0.x/admin-api/#precedence) it’s specified that the priority of the plugins applied globally is the last one.

In this case is only if you try to set a more specific plugin with enabled false when it doesn’t work and the global plugin remains being executed like @flowdopip answered?

Regards