Docs

IP Restriction Configuration

Configuration reference for the IP Restriction plugin (`ip-restriction`): the parameters, each attribute with its type, whether it is required, its default and its accepted values.

Parameters

See plugin common configurations (opens in Apache APISIX docs) for configuration options available to all plugins.

whitelist — array[string] · optional · since APISIX 1.2

List of IPs to whitelist. Support IPv4, IPv6, and CIDR notations.

At least one of the whitelist and blacklist should be configured, but they cannot be configured at the same time.

blacklist — array[string] · optional · since APISIX 1.2

List of IPs to blacklist. Support IPv4, IPv6, and CIDR notations.

At least one of the whitelist and blacklist should be configured, but they cannot be configured at the same time.

message — string · optional · default: Your IP address is not allowed · since APISIX 2.8

Message returned when the IP address is denied access.

response_code — integer · optional · default: 403 · since APISIX 3.13.0 · API7 Gateway 3.10.3

Valid values: between 403 and 404 inclusive

HTTP response code returned when the request is rejected due to IP address restriction. Available in API7 Enterprise from version 3.10.3.