Golf Gateway uses environment variables with the GOLF_ prefix for configuration. This reference covers all variables available when running in Centralized or Distributed mode.
Golf Gateway supports multiple deployment modes. This documentation covers Centralized and Distributed modes, which are the recommended configurations for production deployments.
Minimal configuration to connect a gateway to Control Plane:
# Gateway Identity (Required)# Get these values from the Control Plane when creating a new gatewayexport GOLF_GATEWAY_ID=<uuid-from-control-plane>export GOLF_GATEWAY_API_KEY=<api-key-from-control-plane>export GOLF_GATEWAY_CONTROL_PLANE_URL=https://your-control-plane.example.com# Redis (Required)export GOLF_CACHE_REDIS_URL=redis://localhost:6379/0
Distributed mode uses a local YAML configuration file for servers while connecting to Control Plane for organization policies and monitoring. Use the same environment variables as Centralized mode, plus a golf_gateway.yaml configuration file.
# Same as Centralized modeexport GOLF_GATEWAY_ID=<uuid-from-control-plane>export GOLF_GATEWAY_API_KEY=<api-key-from-control-plane>export GOLF_GATEWAY_CONTROL_PLANE_URL=https://your-control-plane.example.comexport GOLF_CACHE_REDIS_URL=redis://localhost:6379/0# Plus: Create a golf_gateway.yaml file with your server configurations
In Centralized and Distributed modes, server configurations, identity providers, and security policies are managed through the Golf Control Plane or YAML file - not through environment variables.
These variables connect your gateway to the Control Plane. Get these values when creating a new gateway in the Golf Control Plane.Environment prefix: GOLF_GATEWAY_
Variable
Type
Required
Description
GOLF_GATEWAY_ID
UUID
Yes
Gateway UUID from Control Plane
GOLF_GATEWAY_API_KEY
string
Yes
Gateway API key for authentication
GOLF_GATEWAY_CONTROL_PLANE_URL
string
Yes
Control Plane URL (must start with http:// or https://)
Keep your GOLF_GATEWAY_API_KEY secure. It authenticates your gateway to the Control Plane. If compromised, regenerate it in the Golf Control Plane.
The per-user limit applies to authenticated users (and falls back to per-IP for anonymous requests). System-wide (global) and per-server limits exist but are managed through the Control Plane in Centralized mode — they are not configurable via environment variables. See Configure Rate Limiting for the full model.