mirror of
https://github.com/reconurge/flowsint.git
synced 2026-07-16 00:52:35 -05:00
[GH-ISSUE #180] [Docs ] - API 502 Bad Gateway - Podman Compatibility - Windows #3644
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @nidorx on GitHub (Jun 6, 2026).
Original GitHub issue: https://github.com/reconurge/flowsint/issues/180
Problem
When running
docker-compose.prod.ymlwith Podman Compose, the frontend nginx fails to resolve theapiservice hostname, resulting in502 Bad Gatewayon all/api/requests.Root cause
The nginx config inside
flowsint-appuses Docker's embedded DNS resolver:127.0.0.11is Docker Engine specific - it's a hardcoded IP where Docker runs its internal DNS server inside each container. Podman does not use this address. Instead, Podman's DNS resolver runs on the network gateway (typically10.89.0.1), which is written into the container's/etc/resolv.conf.Because
127.0.0.11:53has nothing listening in a Podman container, DNS resolution fails:Fix
1. Remove the Docker-specific resolver from
nginx.confIn
flowsint-app/nginx.conf, replace the resolver + variable pattern with a directproxy_pass:This makes nginx resolve
apiusing the system's DNS configuration (/etc/resolv.conf), which Podman sets up correctly.2. Mount the local
nginx.confinto the containerThe production compose file pulls a pre-built image from GHCR:
Since there is no
build:section, the container runs the baked-innginx.conffrom the registry image (which still has127.0.0.11). Mount the corrected local config as a volume:Then
Docker vs Podman DNS comparison
127.0.0.1110.89.0.1)/etc/resolv.confBy removing the hardcoded
127.0.0.11and letting nginx use the system resolver, the config works on both runtimes.Trade-off
Using
proxy_pass http://api:5001directly (withoutresolver+set) means nginx resolves theapihostname once at startup. If theapicontainer is recreated with a different IP, the nginx container must be restarted to pick up the new address. For typical compose deployments this is acceptable.@dextmorgn commented on GitHub (Jun 8, 2026):
Hey @nidorx,
thank you for this. If you feel like it, could you open a PR ? 🙏
@sophymarine commented on GitHub (Jun 19, 2026):
That
resolver 127.0.0.11 valid=10s;line inflowsint-app/nginx.confpulls double duty. It pins nginx to Docker’s embedded DNS and also allows re‑resolution at runtime becauseproxy_passis built from a variable. Fine in Docker, where 127.0.0.11 always exists. Podman doesn’t run a DNS listener there, so nginx keeps trying and never resolvesapi.Dropping the variable changes the behaviour in a useful way. With
proxy_pass http://api:5001;the hostname is resolved once during startup through libc using/etc/resolv.conf. Podman writes that file with the correct nameserver, so the lookup succeeds.If you later need runtime re‑resolution, I’d template the resolver from
/etc/resolv.conf. Hardcoding Docker’s address tends to break the moment the container runtime changes.@dextmorgn commented on GitHub (Jun 20, 2026):
fixed with
fe8a4a3210