Skip to main content

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


        Relative share of traffic sent to this entry in weighted_upstreams.

      • upstream

        object


        Inline upstream configuration. Only name, type, hash_on, key, nodes, timeout, scheme, pass_host, and upstream_host are applied.

        To use health checks, retries, TLS settings, keepalive pools, warm-up, service discovery, or other upstream options, create an upstream object and set upstream_id.

        • type

          string

          default: roundrobin

          vaild vaule:

          roundrobin, chash, ewma, or least_conn


          Load-balancing algorithm used to select a node within this inline upstream. Use roundrobin for weighted round robin, chash for consistent hashing, ewma for exponential weighted moving average, and least_conn for least connections. The parent weight field controls the traffic share assigned to this upstream.

        • hash_on

          string

          default: vars

          vaild vaule:

          vars, header, cookie, consumer, or vars_combinations


          Used when type is chash. Support hashing on built-in variables, header, cookie, consumer, or a combination of built-in variables.

        • key

          string


          Used when type is chash. When hash_on is set to header or cookie, key is required. When hash_on is set to consumer, key is not required as the consumer name will be used as the key automatically.

        • scheme

          string

          default: http

          vaild vaule:

          API7 Gateway: http or https
          APISIX: http or https; APISIX 3.19.0 and later also support ws and wss


          Protocol used to communicate with the inline upstream. To use another protocol, create an upstream object and set upstream_id.

        • nodes

          object


          Addresses of the upstream nodes.

        • timeout

          object


          Timeout in seconds for connecting, sending and receiving messages.

        • pass_host

          string

          default: pass

          vaild vaule:

          pass, node, or rewrite


          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 in upstream_host.

        • upstream_host

          string


          Used when pass_host is rewrite. Host name of the upstream.

        • name

          string


          Identifier for the upstream for specifying service name, usage scenarios, and so on.