fix(docker): nginx healthcheck uses 127.0.0.1 not localhost — IPv4-only listener
corrosion-nginx reported (unhealthy) despite serving the panel fine: nginx listens 0.0.0.0:80 (IPv4 only, no listen [::]:80), but 'localhost' resolves to ::1 first inside the container, so the probe got connection-refused. Verified: 127.0.0.1:80 serves the SPA. Probe now targets IPv4 explicitly. No nginx config change — the panel was never broken, only the healthcheck's hostname resolution. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
@@ -87,7 +87,10 @@ services:
|
|||||||
api:
|
api:
|
||||||
condition: service_started
|
condition: service_started
|
||||||
healthcheck:
|
healthcheck:
|
||||||
test: ["CMD-SHELL", "wget -q --spider http://localhost:80/ || exit 1"]
|
# 127.0.0.1, not localhost: nginx listens IPv4-only (0.0.0.0:80) but
|
||||||
|
# `localhost` resolves to ::1 first inside the container → the probe hit
|
||||||
|
# nothing and reported unhealthy while the panel served fine on IPv4.
|
||||||
|
test: ["CMD-SHELL", "wget -q --spider http://127.0.0.1:80/ || exit 1"]
|
||||||
interval: 10s
|
interval: 10s
|
||||||
timeout: 5s
|
timeout: 5s
|
||||||
retries: 3
|
retries: 3
|
||||||
|
|||||||
Reference in New Issue
Block a user