# 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[​](#parameters "Direct link to Parameters")

See plugin [common configurations](https://docs.api7.ai/apisix/reference/plugin-common-configurations.md) 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.
