Fix health check path mismatch causing 404s
The app maps health checks at /health (ServiceDefaults), not /api/v1/health. Compose healthcheck and deploy-qa.sh's wait-loop both hit the wrong path. Also add an nginx location for /health since it lives outside the /api prefix that the admin proxy otherwise forwards unchanged.
This commit is contained in:
@@ -36,7 +36,7 @@ services:
|
||||
db:
|
||||
condition: service_healthy
|
||||
healthcheck:
|
||||
test: ["CMD-SHELL", "curl -fsS http://localhost:8080/api/v1/health || exit 1"]
|
||||
test: ["CMD-SHELL", "curl -fsS http://localhost:8080/health || exit 1"]
|
||||
interval: 10s
|
||||
timeout: 5s
|
||||
retries: 5
|
||||
|
||||
@@ -26,7 +26,7 @@ $COMPOSE up -d
|
||||
|
||||
log "Waiting for API health check via admin proxy on port $QA_ADMIN_PORT"
|
||||
attempts=30
|
||||
until curl -fsS "http://localhost:${QA_ADMIN_PORT}/api/v1/health" >/dev/null 2>&1; do
|
||||
until curl -fsS "http://localhost:${QA_ADMIN_PORT}/health" >/dev/null 2>&1; do
|
||||
attempts=$((attempts - 1))
|
||||
if [[ "$attempts" -le 0 ]]; then
|
||||
fail "QA stack did not become healthy in time"
|
||||
|
||||
@@ -20,6 +20,14 @@ server {
|
||||
proxy_read_timeout 30s;
|
||||
}
|
||||
|
||||
# Proxy the API's health endpoint, which lives outside the /api prefix.
|
||||
location = /health {
|
||||
resolver 127.0.0.11 valid=10s ipv6=off;
|
||||
set $api_upstream http://api:8080;
|
||||
proxy_pass $api_upstream/health;
|
||||
proxy_http_version 1.1;
|
||||
}
|
||||
|
||||
# SPA fallback — all other paths serve index.html so Vue Router handles them
|
||||
location / {
|
||||
try_files $uri $uri/ /index.html;
|
||||
|
||||
Reference in New Issue
Block a user