---
schema_version: "1"
id: 8d6efa52ba61ef4bb1b15d3a0db22d60d3df6f2962b0324121c211b46571267f
title: Configure Omni Gateway Environment Variables in Local Mode
collection: mulesoft
version: current
locale: en-us
portal_url: https://docs.salesforce.com/mulesoft/current/en-us/gateway/latest/local-env-variables.md
canonical_url: https://docs.mulesoft.com/gateway/latest/local-env-variables
source_site: docs.mulesoft.com
content_type: documentation
content_hash: cf2300e64a28fc4c56bf0e212ad8f2449c5bcacb754b5e8bbd0445f7b22f1403
description: MuleSoft Documentation Site
release: "1.14"
latest: true
---
---
product: Omni Gateway
version: 1.14
is-latest-version: true
---

# Configure Omni Gateway Environment Variables in Local Mode

> For the full documentation index, see: https://docs.mulesoft.com/llms.txt

Omni Gateway provides these environment variables to configure your gateway:

<table><colgroup><col> <col> <col></colgroup><thead><tr><th>Variable Name</th><th>Default Value</th><th>Description</th></tr></thead><tbody><tr><td><p>FLEX_CONNECTION_IDLE_TIMEOUT_SECONDS</p></td><td><p><code>60</code></p></td><td><p>Maximum number of seconds a connection can be idle before it times out. For more information, see <a href="https://docs.mulesoft.com/gateway/latest/local-timeout">Configuring Timeouts in Local Mode</a>.</p></td></tr><tr><td><p>FLEX_STREAM_IDLE_TIMEOUT_SECONDS</p></td><td><p><code>300</code></p></td><td><p>Maximum number of seconds a stream can remain idle without receiving any data in either the inbound (client to Omni Gateway) or outbound (Omni Gateway to upstream service) direction. For more information, see <a href="https://docs.mulesoft.com/gateway/latest/local-timeout">Configuring Timeouts in Local Mode</a>.</p></td></tr><tr><td><p>FLEX_UPSTREAM_CONNECTION_IDLE_TIMEOUT_SECONDS</p></td><td><p><code>60</code></p></td><td><p>Maximum number of seconds a stream between Omni Gateway and the upstream service can remain idle between requests. For more information, see <a href="https://docs.mulesoft.com/gateway/latest/local-timeout">Configuring Timeouts in Local Mode</a>.</p></td></tr><tr><td><p>FLEX_UPSTREAM_RESPONSE_TIMEOUT_SECONDS</p></td><td><p><code>15</code></p></td><td><p>Maximum number of seconds an Omni Gateway waits for a response from an upstream service. For more information, see <a href="https://docs.mulesoft.com/gateway/latest/local-timeout">Configuring Timeouts in Local Mode</a>.</p></td></tr><tr><td><p>FLEX_ENVOY_HEADERS_ENABLED</p></td><td><p><code>false</code></p></td><td><p>Allows (<code>true</code>) or removes (<code>false</code>) Envoy headers from requests. For more information, see <a href="https://docs.mulesoft.com/gateway/latest/review-prerequisites">Requirements and Limits for Omni Gateway</a>.</p></td></tr><tr><td><p>FLEX_REWRITE_HOST_HEADER</p></td><td><p><code>true</code></p></td><td><p>Rewrite HTTP Host header to match upstream.</p></td></tr><tr><td><p>FLEX_REMOVE_SERVER_HEADER</p></td><td><p><code>false</code></p></td><td><p>Removes the <code>Server</code> HTTP response header from outbound responses when set to <code>true</code>. Set to <code>true</code> to reduce exposure of server implementation details for security or compliance purposes.</p></td></tr><tr><td><p>FLEX_HEADER_RAW_VALUE_ENABLE</p></td><td><p>`tru`e</p></td><td><p>Controls header encoding for external authorization. Set to <code>false</code> to send headers encoded in UTF-8. For more information, see <a href="https://docs.mulesoft.com/gateway/latest/policies-included-external-authorization">External Authorization Policy</a>.</p></td></tr><tr><td><p>FLEX_FORWARD_CLIENT_CERT_DETAILS</p></td><td><p><code>SANITIZE</code></p></td><td><p>Controls how the <code>x-forwarded-client-cert</code> (XFCC) HTTP header is handled. Supported values are <code>SANITIZE</code>, <code>FORWARD_ONLY</code>, <code>APPEND_FORWARD</code>, <code>SANITIZE_SET</code>, and <code>ALWAYS_FORWARD_ONLY</code>. For more information, see <a href="https://www.envoyproxy.io/docs/envoy/latest/api-v3/extensions/filters/network/http_connection_manager/v3/http_connection_manager.proto#envoy-v3-api-enum-extensions-filters-network-http-connection-manager-v3-httpconnectionmanager-forwardclientcertdetails">HTTP connection manager (proto)</a> in the Envoy documentation.</p></td></tr><tr><td><p>FLEX_DOWNSTREAM_CONNECTION_BUFFER_LIMIT_BYTES</p></td><td><p><code>1048576</code> (1 MB)</p></td><td><p>Maximum size, in bytes, of read and write buffers for new connections. For more information, see <a href="https://docs.mulesoft.com/gateway/latest/review-prerequisites">Requirements and Limits for Omni Gateway</a>.</p></td></tr><tr><td><p>FLEX_DATASOURCE_CONTROL_NODE_ENABLED</p></td><td><p><code>true</code></p></td><td><p>Enable configuration caching in Redis shared storage for Connected Mode replicas. This variable is enabled by default. To disable configuration caching, set this variable to <code>false</code>. For more information, see <a href="https://docs.mulesoft.com/gateway/latest/conn-replica-caching">Configuring Omni Gateway Configuration Caching in Connected Mode</a>.</p></td></tr><tr><td><p>FLEX_SERVICE_ENVOY_DRAIN_TIME</p></td><td><p><code>25</code></p></td><td><p>Drain period in seconds during shutdown before Omni Gateway exits gracefully. For more information, see <a href="https://docs.mulesoft.com/gateway/latest/local-monitor">Monitoring in Local Mode</a>.</p></td></tr><tr><td><p>FLEX_SYNC_DEBOUNCE_TIME</p></td><td><p>"5s"</p></td><td><p>Specifies the amount of time to wait after detecting a configuration change before applying it. This prevents excessive reloading during rapid successive changes. The value must be a valid duration string, such as <code>"5s"</code> or <code>"500ms"</code>.</p></td></tr><tr><td><p>FLEX_DNS_REFRESH_RATE</p></td><td><p><code>5s</code></p></td><td><p>Sets how often Omni Gateway refreshes DNS for upstream service clusters. The value is a duration string that is clamped between <code>5s</code> and <code>60s</code>. Values below the minimum or above the maximum are adjusted to the nearest bound.</p></td></tr><tr><td><p>FLEX_LOG_LEVEL</p></td><td><p><code>4</code> (INFO)</p></td><td><p>Sets the logging level for Omni Gateway. For the environment variable configuration of log level, you specify a number that corresponds to the log level. Supported values are NONE:`-1`, FATAL:`0`, ERROR:`1`, WARN:`2`, INFO:`4`, DEBUG:`8`, and TRACE:`16`.</p></td></tr><tr><td><p>FLEX_CONFIG</p></td><td><p>N/A</p></td><td><p>Provides Omni Gateway registration and configuration as a YAML-formatted string. The YAML content must be properly escaped to preserve special characters. Provide your registration and configuration as a string if deploying environments where file mounting isn’t practical, such as Amazon ECS or Azure Container Apps.</p></td></tr></tbody></table>

> [!NOTE] Omni Gateway reads `FLEX_*` environment variables only when it starts. To verify the
> values the gateway is running with, run `flexctl dump` and open `env/vars.json` in the extracted
> ZIP file. For more information, see [Troubleshooting with the CLI](https://docs.mulesoft.com/gateway/latest/troubleshoot-admin-api).
