All Products
Search
Document Center

Alibaba Cloud Service Mesh:Migrate common NGINX configurations to an ASM gateway

Last Updated:Mar 11, 2026

Each NGINX Ingress Controller ConfigMap parameter maps to one or more Istio or Envoy settings on a Service Mesh (ASM) gateway. The tables in this topic cover the most commonly used parameters and their ASM equivalents. For the complete parameter list, see the Ingress NGINX ConfigMap reference.

How ASM gateway configuration differs from NGINX

NGINX consolidates all settings in a single ConfigMap. ASM splits configuration across three Istio resource types:

Istio resourceWhat it controlsTypical NGINX equivalents
GatewayListener ports, TLS termination, HTTPS redirectsssl-redirect
VirtualServiceRouting rules, path rewrites, per-route timeoutsRoute-level annotations
DestinationRuleConnection pools, keepalive, circuit breakingkeep-alive-requests, proxy-connect-timeout, upstream-keepalive-*, max-worker-connections

To apply a mapped setting, create or update the corresponding Istio resource in your cluster.

Connection and keepalive parameters

These parameters control connection pooling, keepalive behavior, and connection limits. In ASM, most of them map to the connectionPool section of a DestinationRule.

NGINX parameterNGINX behaviorASM equivalent
keep-alive-requestsMaximum requests per keepalive connection. The connection closes after this limit.connectionPool.maxRequestsPerConnection in a DestinationRule.
max-worker-connectionsMaximum simultaneous connections per NGINX worker process.connectionPool.tcp.maxConnections in a DestinationRule. Sets the maximum connections to a single destination host.
upstream-keepalive-connectionsMaximum idle keepalive connections cached per worker process.connectionPool.tcp.maxConnections in a DestinationRule.
Note

This field controls the total connection count to a host, not just idle connections. A direct 1:1 value transfer is not appropriate because the scoping differs. Review your connection requirements before migrating this value.

upstream-keepalive-timeoutTimeout for idle keepalive connections to upstream servers.connectionPool.http.idleTimeout in a DestinationRule.

Example: configure connection pooling in a DestinationRule

apiVersion: networking.istio.io/v1
kind: DestinationRule
metadata:
  name: my-service-pool
spec:
  host: my-service.prod.svc.cluster.local
  trafficPolicy:
    connectionPool:
      tcp:
        maxConnections: 100
      http:
        maxRequestsPerConnection: 1000
        idleTimeout: 60s

Timeout parameters

NGINX parameterNGINX behaviorASM equivalent
proxy-connect-timeoutTimeout for establishing a connection to an upstream server. Cannot exceed 75 seconds.connectionPool.http.connectTimeout in a DestinationRule.

Example: set a connect timeout

apiVersion: networking.istio.io/v1
kind: DestinationRule
metadata:
  name: my-service-timeout
spec:
  host: my-service.prod.svc.cluster.local
  trafficPolicy:
    connectionPool:
      http:
        connectTimeout: 30s

Header handling parameters

These parameters control how headers are processed, generated, and validated.

NGINX parameterNGINX behaviorASM equivalent
allow-backend-server-headerAllows the backend to return its own Server header instead of the default NGINX string.Enabled by default on ASM gateways. Default: true.
enable-underscores-in-headersAllows underscores in HTTP header names.Maps to the Envoy headers_with_underscores_action parameter. Default: true.
ignore-invalid-headersIgnores headers with invalid names. Valid names contain letters, digits, and hyphens. Underscore support depends on the underscores_in_headers setting.Envoy uses a Header Validator. Without explicit configuration, Envoy applies its default validation and returns 400 Bad Request for invalid headers. image.png
generate-request-idGenerates a random X-Request-ID value if the header is absent from the incoming request.Maps to the Envoy generate_request_id parameter. Default: true. Modify through an ASM plugin.
server-tokensControls whether NGINX sends its version in the Server response header and on error pages. Default: disabled.ASM gateways set the Server header to the Envoy header by default. Error pages do not display version information.

Forwarding and proxy headers

Three NGINX parameters control X-Forwarded-For behavior. In Istio, they all map to the gateway network topology configuration.

NGINX parameterNGINX behaviorASM equivalent
compute-full-forwarded-forAppends the remote address to the X-Forwarded-For header instead of replacing it.Controlled by the Envoy use_remote_address parameter. Default: true. See Configuring gateway network topology.
forwarded-for-headerSpecifies which header identifies the client's originating IP address.ASM gateways use X-Forwarded-For and do not support custom header names for this purpose.
use-forwarded-headersWhen true, NGINX passes through incoming X-Forwarded-* headers. This is typical when NGINX sits behind another Layer 7 proxy. When false, NGINX ignores incoming values and generates new ones.See Configuring gateway network topology.

TLS and redirect parameters

NGINX parameterNGINX behaviorASM equivalent
ssl-redirectGlobally redirects HTTP to HTTPS when the server has a TLS certificate.Configure tls.httpsRedirect in a Gateway resource.

Example: redirect HTTP to HTTPS

apiVersion: networking.istio.io/v1
kind: Gateway
metadata:
  name: my-gateway
spec:
  servers:
  - port:
      number: 80
      name: http
      protocol: HTTP
    hosts:
    - "example.com"
    tls:
      httpsRedirect: true  # Returns 301 for HTTP requests

Logging and observability

NGINX parameterNGINX behaviorASM equivalent
log-format-upstreamCustomizes the upstream log format.Configure the log format on the Observability Settings page in the ASM console. See Configure observability settings.

Request body limits

NGINX parameterNGINX behaviorASM equivalent
proxy-body-sizeMaximum allowed client request body size. Returns 413 Request Entity Too Large if exceeded.ASM does not have an equivalent setting. Use chunked transfer encoding for large payloads.

Worker and process parameters

NGINX parameterNGINX behaviorASM equivalent
reuse-portCreates a separate listening socket per worker process by using SO_REUSEPORT, which allows the kernel to distribute connections across workers. Default: true.Enabled by default on ASM gateways. Default: true.
worker-cpu-affinityBinds worker processes to specific CPU sets.Not applicable in container environments. Use the default setting.

Configuration extensibility

NGINX parameterNGINX behaviorASM equivalent
allow-snippet-annotationsAllows custom NGINX configuration snippets in Ingress annotations.ASM does not support annotation-based snippets. Edit the IstioGateway YAML directly to customize gateway behavior.

References