Contact Us 1-800-596-4880

Configure Omni Gateway Environment Variables in Local Mode

Omni Gateway provides these environment variables to configure your gateway:

Variable Name Default Value Description

FLEX_CONNECTION_IDLE_TIMEOUT_SECONDS

60

Maximum number of seconds a connection can be idle before it times out. For more information, see Configuring Timeouts in Local Mode.

FLEX_STREAM_IDLE_TIMEOUT_SECONDS

300

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 Configuring Timeouts in Local Mode.

FLEX_UPSTREAM_CONNECTION_IDLE_TIMEOUT_SECONDS

60

Maximum number of seconds a stream between Omni Gateway and the upstream service can remain idle between requests. For more information, see Configuring Timeouts in Local Mode.

FLEX_UPSTREAM_RESPONSE_TIMEOUT_SECONDS

15

Maximum number of seconds an Omni Gateway waits for a response from an upstream service. For more information, see Configuring Timeouts in Local Mode.

FLEX_ENVOY_HEADERS_ENABLED

false

Allows (true) or removes (false) Envoy headers from requests. For more information, see Requirements and Limits for Omni Gateway.

FLEX_REWRITE_HOST_HEADER

true

Rewrite HTTP Host header to match upstream.

FLEX_BASE_PATH_CANONICALIZER_ENABLED

true

Internally rewrites requests that exactly match a slashless API base path, such as /api, to the slash-terminated form (/api/), so that these requests reach the API instance. To disable this behavior, set this variable to false.

FLEX_REMOVE_SERVER_HEADER

false

Removes the Server HTTP response header from outbound responses when set to true. Set to true to reduce exposure of server implementation details for security or compliance purposes.

FLEX_HEADER_RAW_VALUE_ENABLE

`tru`e

Controls header encoding for external authorization. Set to false to send headers encoded in UTF-8. For more information, see External Authorization Policy.

FLEX_FORWARD_CLIENT_CERT_DETAILS

SANITIZE

Controls how the x-forwarded-client-cert (XFCC) HTTP header is handled. Supported values are SANITIZE, FORWARD_ONLY, APPEND_FORWARD, SANITIZE_SET, and ALWAYS_FORWARD_ONLY. For more information, see HTTP connection manager (proto) in the Envoy documentation.

FLEX_DOWNSTREAM_CONNECTION_BUFFER_LIMIT_BYTES

1048576 (1 MB)

Maximum size, in bytes, of read and write buffers for new connections. For more information, see Requirements and Limits for Omni Gateway.

FLEX_DATASOURCE_CONTROL_NODE_ENABLED

true

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 false. For more information, see Configuring Omni Gateway Configuration Caching in Connected Mode.

FLEX_CONTROL_NODE_STORAGE_ENCRYPTION_ENABLED

true

Encrypts the configuration data that configuration caching stores. To disable encryption, set this variable to false. For more information, see conn-replica-caching.adoc#encryption.

FLEX_STORAGE_ENCRYPTION_KEY

N/A

A base64-encoded PEM private key that encrypts the configuration data that configuration caching stores. If not set, Omni Gateway derives the encryption key from the registration private key. For more information, see conn-replica-caching.adoc#encryption.

FLEX_SERVICE_ENVOY_DRAIN_TIME

25

Drain period in seconds during shutdown before Omni Gateway exits gracefully. For more information, see Monitoring in Local Mode.

FLEX_SYNC_DEBOUNCE_TIME

"5s"

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 "5s" or "500ms". For Kubernetes deployments, set this value with the gateway.syncDebounceTime Helm chart value. For more information, see Set Environment Variables for Your Deployment Target.

FLEX_DNS_REFRESH_RATE

5s

Sets how often Omni Gateway refreshes DNS for upstream service clusters. The value is a duration string that is clamped between 5s and 60s. Values below the minimum or above the maximum are adjusted to the nearest bound.

FLEX_LOG_LEVEL

4 (INFO)

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

FLEX_CONFIG

N/A

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.

Set Environment Variables for Your Deployment Target

How you set an environment variable depends on where Omni Gateway runs. The examples in this section set the debounce time variables, but you can use the same approach for any variable in the previous table.

Omni Gateway reads environment variables only when it starts. After you set a variable, restart Omni Gateway to apply the change.

Set Environment Variables in a Docker Container

Pass each variable with the -e option in the docker run start command, for example:

docker run --rm \
-v "$(pwd)":/usr/local/share/mulesoft/flex-gateway/conf.d \
-p 8080:8080 \
-e FLEX_SYNC_DEBOUNCE_TIME=10s \
mulesoft/flex-gateway

Podman uses the same -e option in the podman run start command.

If you use Docker Compose, add the variables to the environment section of the service, for example:

services:
  flex-gateway:
    image: mulesoft/flex-gateway
    environment:
      FLEX_SYNC_DEBOUNCE_TIME: "10s"

Set Environment Variables for a Linux Service

When Omni Gateway runs as a Linux service, systemd sets its environment variables. Add the variables in a drop-in file for the flex-gateway service:

  1. Create a drop-in file named env.conf in the /etc/systemd/system/flex-gateway.service.d/ directory:

    sudo mkdir -p /etc/systemd/system/flex-gateway.service.d
    sudo tee /etc/systemd/system/flex-gateway.service.d/env.conf > /dev/null <<'EOF'
    [Service]
    Environment=FLEX_SYNC_DEBOUNCE_TIME=10s
    EOF

    Don’t edit the override.conf file in the same directory. The Omni Gateway package installs and manages that file.

  2. Reload the systemd configuration and restart Omni Gateway:

    sudo systemctl daemon-reload
    sudo systemctl restart flex-gateway
  3. Verify that the service includes the new variables:

    systemctl show flex-gateway --property=Environment

Set Environment Variables in Kubernetes

When you deploy Omni Gateway with the Helm chart, the chart sets the environment variables on the Omni Gateway pod. Set the debounce times with these Helm chart values:

Helm Chart Value Environment Variable

gateway.syncDebounceTime

FLEX_SYNC_DEBOUNCE_TIME

Don’t use extraEnvs to override a variable that the Helm chart already configures through a chart value. Set the Helm chart value directly instead.

To change the values on an existing deployment, run helm upgrade with the --set option, for example:

helm -n gateway upgrade ingress \
--wait \
--reuse-values \
flex-gateway/flex-gateway \
--set gateway.syncDebounceTime=10s

Alternatively, add the values to a configuration file that you pass with the -f option:

gateway:
  syncDebounceTime: "10s"

To set a variable that doesn’t have a Helm chart value, use extraEnvs, for example:

extraEnvs:
  - name: FLEX_REMOVE_SERVER_HEADER
    value: "true"

For more information about updating Helm chart values, see Update Pod Settings for an Omni Gateway Deployment Through a Helm Chart.

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.