Environment Variables
Golf Gateway uses environment variables with theGOLF_ 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.
Quick Start
Centralized Mode
Minimal configuration to connect a gateway to Control Plane:Distributed Mode
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 agolf_gateway.yaml configuration file.
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.
Complete .env Template
Copy this template and customize for your environment:.env.example
Gateway Identity
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_
Security
Environment prefix:GOLF_SECURITY_
Settings
Operation Mode
Cache (Redis)
Environment prefix:GOLF_CACHE_
Rate Limiting
Environment prefix:GOLF_RATE_LIMIT_
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.
Privacy
Environment prefix:GOLF_PRIVACY_
TLS/mTLS
Environment prefix:GOLF_TLS_
Server TLS
CA Certificate
Mutual TLS (mTLS)
Export: Elasticsearch
Environment prefix:GOLF_ELASTICSEARCH_
Use either
url (self-hosted) or cloud_id (Elastic Cloud), not both.Export: OpenTelemetry
Environment prefix:GOLF_OTEL_
Basic Configuration
Export Targets
Batching
Headers and Attributes
Export: Azure Sentinel
Environment prefix:GOLF_SENTINEL_
Data Collection Rule (DCR)
Azure AD Authentication
Performance
Better Stack Logging
Environment prefix:GOLF_BETTERSTACK_
Related Documentation
YAML Configuration
YAML configuration schema for Distributed mode deployments
Audit Log Schema
Complete audit log entry structure reference
Security Overview
Learn about Golf Gateway’s security features
Deployment Guide
Deploy Golf Gateway to production