From c7dd2be8bc130028313bf7e287c05bfe7b95a44e Mon Sep 17 00:00:00 2001 From: Sajeyks Date: Tue, 10 Nov 2026 14:50:45 +0300 Subject: [PATCH] Listen on [::] so the app is reachable on IPv6-only clusters gunicorn bound to 0.0.0.0:8000, which is IPv4 only. On an IPv6-only network (ungleich's clusters are IPv6 first) every request and probe failed. [::] is dual-stack on Linux. Checked on an IPv6-only and on an IPv4-only Docker network: both probes answer, and migrations reach PostgreSQL by hostname over IPv6. --- gunicorn.conf.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/gunicorn.conf.py b/gunicorn.conf.py index 09ca796..2e84f65 100644 --- a/gunicorn.conf.py +++ b/gunicorn.conf.py @@ -1,7 +1,9 @@ """Gunicorn settings; each can be overridden with GUNICORN_* env vars.""" import os -bind = os.environ.get("GUNICORN_BIND", "0.0.0.0:8000") +# [::] is dual-stack on Linux: it accepts IPv6 and IPv4. 0.0.0.0 would be +# IPv4 only and unreachable on IPv6-only clusters. +bind = os.environ.get("GUNICORN_BIND", "[::]:8000") # Threaded workers: requests mostly wait on LDAP, SMTP and the OTP server. worker_class = "gthread" workers = int(os.environ.get("GUNICORN_WORKERS", "2"))