Skip to main content

Configuration model

Unkey services read configuration from a TOML file passed at startup. Environment variables can be referenced with ${VAR} and are expanded before parsing. Defaults and validation run after parsing. The config schema maps to svc/frontline/config.go. Minimal config example:
string
Instance identifier for logs and tracing.
int
default:"7070"
Plain-HTTP listener port. Serves ACME HTTP-01 challenges and 308-redirects everything else to https://.
int
default:"7443"
HTTPS listener port. Terminates TLS, runs the policy engine, and forwards customer traffic to a deployment instance (or to a peer frontline in another region).
string
required
Cloud provider identifier (for example, aws, gcp, or local).
string
required
Region label for routing.
string
default:"unkey.cloud"
Apex domain for regional routing.
int
default:"10"
Maximum number of routing hops.
object
required
Control API connection settings.
int
Prometheus metrics port. Set to 0 to disable.
duration
default:"15m"
Maximum duration for a proxied request before the context is cancelled and a 504 is returned.
object
TLS settings for HTTPS.
object
MySQL configuration.
object
ClickHouse analytics storage for request-level events. When the URL is empty, a no-op backend is used and no request telemetry is recorded.
object
Redis connection for distributed rate limiting and usage limiting in the policy engine. When the URL is empty, an in-memory counter is used as a fallback and rate limits are not shared across replicas.
object
Vault connection.
object
Tracing and logging configuration.
object
Go pprof profiling endpoints on a loopback-only listener. Disabled when omitted or when credentials are empty.

Environment variables

The Helm chart provides these variables for the default config template:
env
required
Region label.
env
Apex domain for routing.
env
required
Control API address.
env
required
Preshared bearer token for authenticated Control API requests.
env
Vault URL.
env
Vault token.
env
required
MySQL primary DSN.
env
MySQL read replica DSN.
env
ClickHouse connection string for request telemetry. Optional.
env
Redis connection string for distributed rate limiting. Optional.

Example configuration