Troubleshooting guide
Nginx Proxy Manager WebSocket 502 After Restart: Check the Upgrade Header
Category: Reverse Proxy & SSL
You restarted Nginx Proxy Manager, and now the proxy host returns 502 even though your self-hosted service answers on its direct port.
Confirm the upstream is reachable
From the NPM container, run curl -v http://<upstream-ip>:<port>/ using the exact host and port in your proxy host. A 200 or 101 means the upstream is fine and the fault is in the proxy configuration. A connection refused or timeout means fix networking first.
Check the WebSocket Upgrade headers
Open the proxy host, go to Advanced, and inspect the custom Nginx configuration. For WebSocket routes, the proxy must forward the upgrade handshake. A common cause of the nginx proxy manager websocket 502 is a missing or duplicated proxy_set_header Upgrade $http_upgrade; and proxy_set_header Connection "upgrade"; pair. If the block is absent, add it. If it appears twice, remove the duplicate. Save and restart the proxy host.
Verify with a controlled test
Use curl -i -H "Connection: Upgrade" -H "Upgrade: websocket" http://<your-domain>/ and look for 101 Switching Protocols. A 502 here confirms the proxy still cannot complete the upstream handshake. A 101 means the route is restored.
Rollback if needed
If the change makes things worse, revert the Advanced block to its previous content and restart. Keep a copy of the original configuration before editing.
If the 101 test still fails,

Ask for help with your curl output and proxy host settings.
Repeat the same check after a restart and confirm the result twice.
Repeat the same check after a restart and confirm the result twice.