Skip to content

Healthcheck Next.js concepts

createNextHealthRoute() runs one health scope and returns JSON or summary output. createNextMetricsRoute() runs all by default and emits Prometheus, OpenMetrics, or JSON.

Health handlers use the configured core HTTP policy. Responses carry no-store headers plus status, scope, duration, service, and optional instance headers.

Protection supports bearer token, Basic auth, IPv4 address, and IPv4 CIDR policies. IP policies require explicit trustProxy: true; the first configured proxy-header address is trusted.