# Proxy Mirror Configuration

The `proxy-mirror` plugin copies all incoming requests or a sampled portion to a secondary upstream for inspection, testing, or analysis.<!-- --> <!-- -->Configuration covers static settings and plugin parameters.

## Static Configurations[​](#static-configurations "Direct link to Static Configurations")

By default, timeout values for the plugin are pre-configured in the [default configuration](https://github.com/apache/apisix/blob/master/apisix/cli/config.lua).

The file to update depends on how the gateway is deployed:

* Host or Docker
* Kubernetes (Helm)

For host or Docker deployments, configure the following settings:

config.yaml

```
plugin_attr:

  proxy-mirror:

    timeout:

      connect: 60s

      read: 60s

      send: 60s
```

Then reload the gateway for changes to take effect.

For Helm deployments, update the chart values that render `plugin_attr.proxy-mirror`. Keep the rest of your values file unchanged.

For the APISIX Helm chart, set the following values:

values.yaml

```
apisix:

  pluginAttrs:

    proxy-mirror:

      timeout:

        connect: 60s

        read: 60s

        send: 60s
```

For the API7 Gateway Helm chart, set the following values:

values.yaml

```
pluginAttrs:

  proxy-mirror:

    timeout:

      connect: 60s

      read: 60s

      send: 60s
```

Then apply the values file with the chart used for this gateway release:

```
helm upgrade <release-name> <chart-name> -n <namespace> -f values.yaml
```

## 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.

* host

  string

  required

  ***

  Address of the host to forward the mirrored traffic to. The address should contain the scheme but without the path, such as `http://127.0.0.1:8081`.

* path

  string

  ***

  Request path to use for mirrored HTTP traffic. If unspecified, the current route URI path is used. For native gRPC and grpc-web traffic, this field is ignored and the gateway preserves the effective gRPC method path after access-phase rewrites.

* path\_concat\_mode

  string

  default: `replace`

  valid value:

  `replace` or `prefix`

  ***

  Concatenation mode when `path` is specified. When set to `replace`, the configured path replaces the request path. When set to `prefix`, the request path is appended to the configured path. For native gRPC and grpc-web traffic, this field is ignored and the gateway preserves the effective gRPC method path.

* sample\_ratio

  number

  default: `1`

  valid value:

  between 0.00001 and 1 inclusive

  ***

  Ratio of requests to mirror. By default, all requests are mirrored.
