Skip to main content

Request Decompress Configuration

The request-decompress plugin decompresses a gzip or deflate request body so that the plugins on the route and, optionally, the upstream service receive the plain body. Configuration covers plugin parameters.

Parameters​

See plugin common configurations for configuration options available to all plugins.

  • max_req_body_size

    integer

    default: 1048576

    valid value:

    >= 1

    Maximum size in bytes for both the encoded request body and the decompressed result. The gateway rejects either one with 413 when it exceeds this value.

    The limit is enforced while the body is read and decompressed, so an oversized result is not buffered in full. Requests without a Content-Encoding header are not read or checked by this plugin. Set nginx_config.http.client_max_body_size in the gateway's config.yaml for a gateway-wide limit, or use the client-control plugin to set a limit on a route or service.

  • forward_compressed

    boolean

    default: false


    If true, plugins that run after request-decompress and before the request is proxied receive the decompressed body, while the upstream receives compressed data. The plugin restores the original bytes when the body is unchanged and recompresses it when another plugin modifies it.

    Log-phase plugins read the same compressed body that was sent upstream.