For a Compose Node service behind nginx the production habits that save the most time are: multi-stage build so the runtime image has no build toolchain, a non-root user, and the app listening only on the compose network — not published on the host. Resolve the upstream by service name and expose only 80/443 from the proxy; publishing the Node port on the host can bypass host firewall rules and widen the attack surface.
Path joining and stale DNS still cause most post-redeploy 502s: a trailing-slash mismatch between location and proxy_pass doubles or strips a prefix, and a long-lived nginx worker can keep a dead task IP after recreate unless you use a variable-plus-resolver pattern or recreate the proxy on deploy. After compose up I curl the Node service name from the proxy container first, then the same path through published 80/443, and compare status and timing. Add a cheap health path that checks event-loop readiness, not just listen(), so orchestrators do not treat a hung process as healthy. Pin proxy_http_version 1.1 with Connection cleared and forward Host plus the X-Forwarded-* headers so Node sees the public scheme.