# UA Restriction Configuration

The `ua-restriction` plugin restricts access to upstream resources using an allowlist or denylist of user agents, preventing overload from web crawlers and enhancing API security.<!-- --> <!-- -->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.

* bypass\_missing

  boolean

  default: `false`

  ***

  If true, bypass the user agent restriction check when the `User-Agent` header is missing.

* allowlist

  array\[string]

  ***

  List of user agents to allow. Support regular expressions.

  At least one of the `allowlist` and `denylist` should be configured, but they cannot be configured at the same time.

* denylist

  array\[string]

  ***

  List of user agents to deny. Support regular expressions.

  In API7 Enterprise 3.9.19 and 3.10.7, and in APISIX 3.19.0, the plugin evaluates repeated `User-Agent` headers independently. A request is rejected with HTTP 403 if any value matches the denylist; an allowed value does not override a denied one.

  At least one of the `allowlist` and `denylist` should be configured, but they cannot be configured at the same time.

* message

  string

  default: `Not allowed`

  ***

  Message returned when the user agent is denied access.
