Nginx Proxy Manager works cleanly as the edge when its container alone binds the host 80/443 listeners and every proxied app stays on a shared Docker network without publishing its own ports. Map each public hostname to the upstream service name and internal port rather than a host-mapped port, so a container recreate does not orphan the proxy host entry. Keep the admin UI off the open internet — bind it to localhost or an internal network and reach it over SSH tunnel or a separate locked-down hostname — and issue certificates only after DNS A/AAAA for that hostname already points at the box.
After adding a proxy host I verify the certificate SANs cover the advertised name, that force-SSL yields one redirect hop, and that the upstream still receives the original Host and X-Forwarded-Proto. A 502 right after deploy is almost always reachability from the NPM container to the service name (wrong network or typo’d port), not the certificate; curl the upstream from inside the NPM container first, then through the public hostname, and compare status and Location so a path or scheme rewrite is not chased as an app crash.