All Products
Search
Document Center

API Gateway:Adjust gateway engine configurations

Last Updated:Sep 18, 2025

Proper configurations of the cloud-native API gateway engine can improve network performance, reliability, and security, ensuring stable operation and user experience. This article introduces how to adjust parameters and provides detailed information on each one.

Prerequisites

Create a cloud-native API gateway.

Steps

Note
  • To ensure instance stability, only the parameters displayed in the console can be modified.

  • Before modifying a parameter value, refer to its valid range on the Gateway Engine Parameters page in the console.

  1. Log on to the API Gateway console.

  2. In the left-side navigation pane, click Cloud-native API Gateway > Instance. In the top navigation bar, select a region.

  3. On the Instance page, click the target instance ID.

  4. In the navigation pane on the left, choose Parameter Settings. In the Gateway Engine Parameters section, find the target parameter and click Edit in the Actions column. Set the parameter value according to the following table and click OK.

Gateway engine parameter description

Parameter

Type

Valid range

Default value

Description

EnableHttp2

bool

[true, false]

false

Applies to the request phase. Specifies whether to use HTTP/2 when the server and client negotiate the protocol.

  • true: Use HTTP/2.

  • false: Do not use HTTP/2.

EnableGenerateRequestId

bool

[true, false]

true

Applies to the request scope. If enabled, the gateway generates a request ID (X-Request-Id) in the request header to uniquely identify the request.

  • true: Generates a request ID in the request header

  • false: Does not insert a request ID into the request header.

EnableGzip

bool

[true, false]

false

Applies to the response phases.

  • true: Compresses responses using Gzip. This reduces gateway traffic but increases the CPU consumption of the gateway.

  • false: Returns the original response.

EnableGzipHardwareAccelerate

bool

[true, false]

false

Performs Gzip compression based on dedicated hardware. If enabled, responses are compressed, which significantly reduces gateway traffic. This method provides higher performance and lower CPU consumption than software-based Gzip compression.

  • true: Enables Gzip hardware acceleration.

  • false: Disables Gzip hardware acceleration.

Important
  • This feature is unavailable in unsupported regions, or if you did not enable Gzip hardware acceleration when you purchased the instance.

  • After this feature is enabled, the EnableGzip and ZipAlgorithm parameters will no longer take effect.

EnableSlashMerge

bool

[true, false]

false

Applies to the request phase. Specifies whether to merge consecutive slashes (/) in the request path.

  • true: The redundant / in www.example.com//b is merged, making it the same as www.example.com/b.

  • false: Consecutive slashes (/) will not be merged.

DownstreamIdleTime

integer

[0, 600]

300

Applies to gateway connections. If no requests are sent from a client to the gateway within the specified period, the connection is closed. Unit: seconds.

PreserveHeaderFormat

bool

[true, false]

false

Applies to the request and response phases. According to the HTTP/1.1 specification, header names are case-insensitive. To ensure compatibility with the HTTP/2 specification, header names are converted to lowercase by default.

  • true: Preserves the case of request and response headers.

  • false: Converts request and response headers to lowercase.

DownstreamConnectionBufferLimits

integer

[0, 2147483647]

32768

Applies to gateway connections. Controls the buffer size for a single connection. This setting affects throughput and the memory usage of the gateway. Unit: bytes.

EnableHardwareAccelerate

bool

[true, false]

true

Applies to TLS encryption and decryption. Specifies whether to enable hardware acceleration. This parameter does not take effect if your region does not support hardware acceleration or if you did not enable it when you purchased the instance.

  • true: Enables hardware acceleration.

  • false: Disables hardware acceleration.

Note

Due to hardware limitations, hardware acceleration is supported only in the China (Beijing), China (Hangzhou), China (Shanghai), China (Shenzhen), and Asia Pacific SE 1 (Singapore) regions.

XffTrustedNum

integer

[0, 10]

0

Applies to the request phase and specifies the number of trusted proxies located before the gateway. It affects whether the gateway will use client-generated request headers such as x-forwarded-for and x-request-id

If the value is 0, the gateway uses the peer socket IP address as the originating IP address and passes it to the backend in the `x-envoy-external-address` request header.

If the value is not 0, the gateway determines the originating IP address from the `x-forwarded-for` header, which already includes the socket IP address. The gateway skips the specified number of hops from right to left and then extracts the originating IP address. This IP address is then passed to the backend in the `x-envoy-external-address` request header. The gateway also preserves the client-sent `x-request-id` and `x-forwarded-proto` headers without modification.

DownstreamHttp2MaxConcurrentStream

integer

[0, 2147483647]

100

Applies to the request phase. The maximum number of concurrent streams on a single connection when a client uses HTTP/2.

InitialStreamWindowSize

integer

[65535, 2147483647]

65535

Applies to the request phase. The initial stream window size negotiated between the gateway and the client when using HTTP/2. Unit: byte.

InitialConnectionWindowSize

integer

[0, 2147483647]

1048576

Applies to the request phase. The initial connection-level window size when the gateway and client use HTTP/2. Unit: byte.

EnableHttp3

bool

[true, false]

false

Applies to the request phase. Specifies whether the downstream client and the gateway use HTTP/3 or not.

  • true: Use HTTP/3.

  • false: Not use HTTP/3.

UpstreamIdleTimeout

int

[0, 600]

30

Applies to gateway connections. If no requests are sent from the gateway to the upstream service within the specified period, the connection is closed. Unit: seconds.

PathWithEscapedSlashes

string

  • KEEP_UNCHANGED

  • REJECT_REQUEST

  • UNESCAPE_AND_REDIRECT

  • UNESCAPE_AND_FORWARD

KEEP_UNCHANGED

The forwarding rule for requests whose Uniform Resource Identifier (URI) path contains escape characters such as %2F, %2f, %5C, or %5c.

  • KEEP_UNCHANGED: Keeps the path unchanged.

  • REJECT_REQUEST: The gateway returns a 400 error and rejects the request.

  • UNESCAPE_AND_REDIRECT: Unescapes the characters and performs a redirection.

  • UNESCAPE_AND_FORWARD: Unescapes the characters and forwards the request.

ZipAlgorithm

List<string>

[brotli, gzip]

gzip

The algorithm to use after compression is enabled. You can select brotli or gzip.

If you specify both gzip and brotli, and their q-values in the `Accept-Encoding` header are the same, the algorithm that appears first in the list is used.

EnableProxyProtocol

bool

[true, false]

false

Enables the Proxy protocol. If the ingress traffic of the gateway is routed through a Network Load Balancer (NLB), you must enable this feature to obtain the originating IP address of the client. Enabling this feature does not affect requests that do not use the Proxy protocol.

EnableCustomAuthConfigPush

bool

[true, false]

false

Applies to scenarios where a self-managed authentication service is used. If enabled, changes to authentication rules do not cause connection interruptions. This is suitable for WebSocket and online business scenarios.