fix: make nginx resolver Podman-compatible

Remove Docker-specific resolver (127.0.0.11) in favor of direct
proxy_pass, which falls back to the system resolver (/etc/resolv.conf).
Mount local nginx.conf into the prod image to override the baked-in config.
This commit is contained in:
dextmorgn
2026-06-20 17:44:57 +02:00
parent ddc943790b
commit fe8a4a3210
2 changed files with 7 additions and 6 deletions

View File

@@ -149,6 +149,9 @@ services:
ports:
# The only network-facing port. Serves the UI and proxies /api/ to the API.
- "5173:8080"
volumes:
# Override the baked-in nginx.conf to use system resolver (Podman-compatible).
- ./flowsint-app/nginx.conf:/etc/nginx/nginx.conf:ro
networks:
- flowsint_network
depends_on:

View File

@@ -58,13 +58,11 @@ http {
add_header Referrer-Policy "strict-origin-when-cross-origin" always;
# API reverse proxy — same-origin, no CORS needed.
# Expects the API service to be reachable as "api:5001" on the Docker network.
# Expects the API service to be reachable as "api:5001" on the compose network.
# Uses system resolver (/etc/resolv.conf) — compatible with Docker and Podman.
# Trade-off: hostname resolved once at startup; restart app if api IP changes.
location /api/ {
# Resolve at request time via Docker's embedded DNS: survives api
# container restarts and lets nginx boot before api is up.
resolver 127.0.0.11 valid=10s;
set $api_upstream http://api:5001;
proxy_pass $api_upstream;
proxy_pass http://api:5001;
proxy_http_version 1.1;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;