server { listen 80; root /usr/share/nginx/html; index index.html; # SPA routing — all non-asset paths → index.html location / { try_files $uri $uri/ /index.html; } # Proxy API requests to FastAPI (Docker bridge, service name) location /api/ { proxy_pass http://api:8522; proxy_set_header Host $http_host; proxy_set_header X-Real-IP $remote_addr; } }