Responsibilities
- Terminate TLS for apex and custom domains using SNI, and redirect plain HTTP to HTTPS.
- Resolve the request hostname to a deployment using control-plane data in MySQL, with short-lived routing and certificate caches to avoid a round trip on every request.
- Evaluate the deployment’s policies (KeyAuth, rate limiting, firewall, OpenAPI validation) before proxying. A request that fails a policy receives a structured error and never reaches the instance.
- Select a healthy instance of the deployment in the same region and proxy the request directly, streaming the response back. When no local instance exists, forward to a peer Frontline in another region.
- Strip any client-supplied
X-Unkey-Principalheader and set the verified principal after authentication, so downstream code can trust it. - Record request telemetry to ClickHouse and expose Prometheus metrics.
Architecture position
Runtime subsystems
Frontline embeds the subsystems policy execution needs. Rate limit policies use Unkey’s rate limiting service rather than a Frontline-owned counter implementation.Related pages
- Ingress for TLS termination, hostname resolution, and cross-region routing
- Routing for instance selection and failover
- Request flow for the full lifecycle of a proxied request
- Policies for the policy engine
- Configuration for config fields and defaults