---
schema_version: "1"
id: 8fdcc6cd31d262123aedcb89f4927a840ae7f1f6cce8562363e3ae0fcd6da2f5
title: Configuring PROXY Protocol in Connected Mode
collection: mulesoft
version: current
locale: en-us
portal_url: https://docs.salesforce.com/mulesoft/current/en-us/gateway/1.9/flex-conn-proxy-protocol.md
canonical_url: https://docs.mulesoft.com/gateway/1.9/flex-conn-proxy-protocol
source_site: docs.mulesoft.com
content_type: documentation
content_hash: bae6a3ed9a2671aafdf1a27f7e7d978f66f1e44b7a806e5d83124b71f8e983b8
description: MuleSoft Documentation Site
release: "1.9"
latest: false
---
---
product: Omni Gateway
version: 1.9
---

# Configuring PROXY Protocol in Connected Mode

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

For use cases when Flex Gateway is deployed behind a load balancer or other proxy service, configure
PROXY protocol to preserve client IP addresses across multiple layers of NAT or TCP proxies.

In PROXY protocol, the load balancer or other proxy service sends the PROXY protocol header
containing the client address and additional information to Flex Gateway. To learn more about PROXY
protocol, see the
[HAProxy specification](https://www.haproxy.org/download/1.8/doc/proxy-protocol.txt).

Enabling PROXY protocol only enables Flex Gateway to receive the PROXY protocol header. Your load
balancer or other proxy service must support PROXY protocol to transmit the header.

<table><colgroup><col> <col> <col></colgroup><tbody><tr><td><div><div><p><span><a href="#linux"><img src="https://docs.mulesoft.com/gateway/1.9/_images/install-linux-logo.png" alt="20%" width="20%"></a></span></p></div></div></td><td><div><div><p><span><a href="#docker"><img src="https://docs.mulesoft.com/gateway/1.9/_images/install-docker-logo.png" alt="25%" width="25%"></a></span></p></div></div></td><td><div><div><p><span><a href="#kubernetes"><img src="https://docs.mulesoft.com/gateway/1.9/_images/install-kubernetes-logo.png" alt="20%" width="20%"></a></span></p></div></div></td></tr><tr><td><div><div><p><a href="#linux">Enable PROXY Protocol for Flex Gateway as a Linux Service</a></p></div></div></td><td><div><div><p><a href="#docker">Enable PROXY Protocol for Flex Gateway in a Docker Container</a></p></div></div></td><td><div><div><p><a href="#kubernetes">Enable PROXY Protocol for Flex Gateway in a Kubernetes Cluster</a></p></div></div></td></tr></tbody></table>

## Before You Begin

Before enabling PROXY protocol for Flex Gateway, complete the following tasks:

1.  [Download Flex Gateway](https://docs.mulesoft.com/gateway/1.9/flex-install)

2.  [Register and Run Flex Gateway](https://docs.mulesoft.com/gateway/1.9/flex-conn-reg-run)

## Enable PROXY Protocol for Flex Gateway as a Linux Service

1.  Create a YAML configuration file in the Flex Gateway configuration directory:

    ```ssh
    sudo touch /usr/local/share/mulesoft/flex-gateway/conf.d/proxy-protocol-config.yaml
    ```

2.  Update the file with the PROXY protocol configuration file:

    ```yaml
    apiVersion: gateway.mulesoft.com/v1alpha1
    kind: Configuration
    metadata:
      name: config
    spec:
      proxyProtocol:
        enabled: true
    ```

## Enable PROXY Protocol for Flex Gateway in a Docker Container

> [!NOTE] If you have already added a volume for a folder with your Flex Gateway configuration
> files, skip to the last step.

1.  Press Ctrl+C to stop your Flex Gateway and any replicas.

2.  Create a folder named `app` in the directory with your Flex Gateway configuration files.

3.  Restart your Flex Gateway with an additional volume for the new `app` directory:

    ```ssh
    docker run --rm \
    -v "$(pwd)":/usr/local/share/mulesoft/flex-gateway/conf.d \
    -p 8080:8080 \
    mulesoft/flex-gateway
    ```

    > [!NOTE] Specify an optional name you want to assign to your Flex Replica by including the
    > following: `-e FLEX_NAME=<name-for-flex-replica> \`.

4.  Create and save a YAML configuration file in your `app` folder with your PROXY protocol
    configuration details.

    ```yaml
    apiVersion: gateway.mulesoft.com/v1alpha1
    kind: Configuration
    metadata:
      name: config
    spec:
      proxyProtocol:
        enabled: true
    ```

## Enable PROXY Protocol for Flex Gateway in a Kubernetes Cluster

To configure PROXY protocol for Flex Gateway, create a new resource using a YAML configuration file
with your PROXY protocol details.

```yaml
apiVersion: gateway.mulesoft.com/v1alpha1
kind: Configuration
metadata:
  name: config
spec:
  proxyProtocol:
    enabled: true
```

## See Also

- [HAProxy specification](https://www.haproxy.org/download/1.8/doc/proxy-protocol.txt)
