Skip to content

Configurable HTTP health-check path (default /up, not /) #6

@sylvesterdamgaard

Description

@sylvesterdamgaard

Motivation

cbox-init's nginx HTTP health check currently targets /. That's the actual application root — it executes the framework, hits the cache, the database, every middleware. Two real problems flow from this:

  1. Cold-start failure. If the framework needs warmup work on first boot (Laravel route:cache / view:cache, Statamic stache rebuild, etc.), / returns 500 until that finishes — and cbox-init flags the container unhealthy. We hit this directly testing Statamic against the image: container booted fine, FPM was up, nginx was up, but / 500'd until php please stache:warm ran. Health check escalated to consecutive_fails warnings while the app was actually fine.
  2. Health-check overhead. Probing the full app stack 1× per second (or whatever the interval is) generates load that has nothing to do with whether nginx + FPM are up. A dedicated lightweight endpoint is the standard pattern.

Laravel ships /up exactly for this since v11. Symfony, Lumen, and most app frameworks have an equivalent. Many Statamic / WordPress users add a static /health.html for the same reason.

Proposal

  • Add CBOX_INIT_HEALTH_CHECK_PATH (or whatever fits the existing namespacing) — default /up
  • Document fallback behaviour: if /up returns 404, log a hint suggesting the user define their own health endpoint
  • Optional: support TCP-only mode (skip HTTP probe entirely) via CBOX_INIT_HEALTH_CHECK_TYPE=tcp

Acceptance criteria

  • Health-check path configurable via env var
  • Default changed to /up
  • TCP-only mode documented
  • Existing behaviour preserved if user explicitly sets path to /

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions