Configuring PROXY Protocol in Local Mode
For use cases when Omni 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 Omni Gateway. To learn more about PROXY protocol, see the HAProxy specification.
Enabling PROXY protocol only enables Omni Gateway to receive the PROXY protocol header. Your load balancer or other proxy service must support PROXY protocol to transmit the header.
Enable PROXY Protocol for Omni Gateway as a Linux Service
-
Create a YAML configuration file in the Omni Gateway configuration directory:
sudo touch /usr/local/share/mulesoft/flex-gateway/conf.d/proxy-protocol-config.yaml -
Update the file with the PROXY protocol configuration file:
apiVersion: gateway.mulesoft.com/v1alpha1 kind: Configuration metadata: name: config spec: proxyProtocol: enabled: true
Enable PROXY Protocol for Omni Gateway in a Docker Container
| If you have already added a volume for a folder with your Omni Gateway configuration files, skip to the last step. |
-
Press Ctrl+C to stop your Omni Gateway and any replicas.
-
Create a folder named
appin the directory with your Omni Gateway configuration files. -
Restart your Omni Gateway with an additional volume for the new
appdirectory:docker run --rm \ -v "$(pwd)":/usr/local/share/mulesoft/flex-gateway/conf.d \ -p 8080:8080 \ mulesoft/flex-gatewaySpecify an optional name you want to assign to your Omni Replica by including the following: -e FLEX_NAME=<name-for-flex-replica> \. -
Create and save a YAML configuration file in your
appfolder with your PROXY protocol configuration details.apiVersion: gateway.mulesoft.com/v1alpha1 kind: Configuration metadata: name: config spec: proxyProtocol: enabled: true
Enable PROXY Protocol for Omni Gateway in a Kubernetes Cluster
To configure PROXY protocol for Omni Gateway, create a new resource using a YAML configuration file with your PROXY protocol details.
apiVersion: gateway.mulesoft.com/v1alpha1
kind: Configuration
metadata:
name: config
spec:
proxyProtocol:
enabled: true






