Skip to main content

URI Blocker Configuration

The uri-blocker plugin rejects requests whose path or query string matches configured regular expressions, with optional case-insensitive matching. Configuration covers plugin parameters.

Parameters​

See plugin common configurations for configuration options available to all plugins.

  • block_rules

    array[string]

    required

    valid value:

    unique regular expressions, each between 1 and 4096 characters

    Regular expressions matched with OR logic against the normalized request path and query string. An unanchored expression can match anywhere in the URI.

    The gateway compiles each expression when it loads the plugin configuration. Invalid syntax prevents that configuration from taking effect.

    An empty array matches every request handled by the plugin. Configure at least one nonempty rule unless blocking all matched requests is intentional.

  • rejected_code

    integer

    default: 403

    valid value:

    greater than or equal to 200

    HTTP status code returned when a rule matches.

  • rejected_msg

    string

    valid value:

    at least 1 character

    Message returned in the JSON error_msg field when a rule matches.

  • case_insensitive

    boolean

    default: false


    If true, match all rules without regard to letter case.