# Docker's embedded DNS (127.0.0.11) — required so nginx re-resolves # `eden-api` per request instead of caching its IP once at worker start # (the classic Docker+nginx gotcha: a static `proxy_pass http://eden-api:8080` # would keep routing to a stale IP forever after eden-api is recreated). resolver 127.0.0.11 valid=30s; server { listen 80; server_name _; root /usr/share/nginx/html; index index.html; # Same-origin API proxy — the API has no public domain of its own # (operator decision: internal-only), so the browser always calls # /api/... on THIS domain, and this container's own nginx forwards it # internally to eden-api over the shared `eden_net` Docker network. # No path rewrite: eden-api's own global prefix is "api" # (main.ts's setGlobalPrefix("api")), so the incoming /api/... URI is # forwarded byte-for-byte. location /api/ { set $eden_api_upstream eden-api:8080; proxy_pass http://$eden_api_upstream; proxy_http_version 1.1; proxy_set_header Host $host; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header X-Forwarded-Proto $scheme; } location / { try_files $uri $uri/ /index.html; } location = /healthz { return 200 "ok\n"; add_header Content-Type text/plain; } }