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:
- 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.
- 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
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:route:cache/view:cache, Statamic stache rebuild, etc.),/returns 500 until that finishes — andcbox-initflags the container unhealthy. We hit this directly testing Statamic against the image: container booted fine, FPM was up, nginx was up, but/500'd untilphp please stache:warmran. Health check escalated toconsecutive_failswarnings while the app was actually fine.Laravel ships
/upexactly for this since v11. Symfony, Lumen, and most app frameworks have an equivalent. Many Statamic / WordPress users add a static/health.htmlfor the same reason.Proposal
CBOX_INIT_HEALTH_CHECK_PATH(or whatever fits the existing namespacing) — default/up/upreturns 404, log a hint suggesting the user define their own health endpointCBOX_INIT_HEALTH_CHECK_TYPE=tcpAcceptance criteria
/up/