Parameters
See plugin common configurations for configuration options available to all plugins.
rules
array[object]
An array of one or more pairs of matching conditions and actions to be executed.
match
array[object]
Rules to match for conditional traffic split.
vars
array[array]
An array of one or more matching conditions in the form of APISIX expressions to conditionally execute the plugin.
weighted_upstreams
array[object]
List of upstream configurations.
upstream_id
string or integer
ID of the configured upstream object.
weight
integer
default:
1
Weight for each upstream.
upstream
object[object]
Configuration of the upstream.
Certain configuration options of upstream are not supported here. These fields are
service_name
,discovery_type
,checks
,retries
,retry_timeout
,desc
, andlabels
. As a workaround, you can create an upstream object and configure it inupstream_id
.type
array
default:
roundrobin
vaild vaule:
roundrobin
orchash
Algorithm for traffic splitting.
roundrobin
for weighted round robin andchash
for consistent hashing.hash_on
array
default:
vars
vaild vaule:
vars
,headers
,cookie
,consumer
, orvars_combinations
Used when
type
ischash
. Support hashing on built-in variables, headers, cookie, consumer, or a combination of built-in variables.key
string
Used when
type
ischash
. Whenhash_on
is set toheader
orcookie
,key
is required. Whenhash_on
is set toconsumer
,key
is not required as the consumer name will be used as the key automatically.nodes
object
Addresses of the upstream nodes.
timeout
object
Timeout in seconds for connecting, sending and receiving messages.
pass_host
array
default:
pass
vaild vaule:
pass
,node
, orrewrite
Mode deciding how the host name is passed.
pass
passes the client's host name to the upstream.node
passes the host configured in the node of the upstream.rewrite
passes the value configured inupstream_host
.upstream_host
string
Used when
pass_host
isrewrite
. Host name of the upstream.name
string
Identifier for the upstream for specifying service name, usage scenarios, and so on.