Fix AWS Node.js 502 Error
Budget: ₹600 – ₹1,500 INR
My Node.js app sits behind Nginx on an AWS EC2 instance and every request is now met with a 502 Bad Gateway. The reverse-proxy looks fine, yet the site stays down because the application itself crashes and never comes back up—especially noticeable right after an EC2 reboot.
I need the crash diagnosed, the root cause fixed, and the service made resilient so it survives reboots without manual intervention. You are free to use tools such as PM2, systemd, or any proven method, as long as the solution is clean and documented.
Deliverables
• Identify and confirm the exact reason the Node.js process dies after a reboot.
• Apply a permanent fix and restart policy so Nginx always has a healthy upstream.
• Provide a brief summary of the steps taken and any configuration files modified.
I need the crash diagnosed, the root cause fixed, and the service made resilient so it survives reboots without manual intervention. You are free to use tools such as PM2, systemd, or any proven method, as long as the solution is clean and documented.
Deliverables
• Identify and confirm the exact reason the Node.js process dies after a reboot.
• Apply a permanent fix and restart policy so Nginx always has a healthy upstream.
• Provide a brief summary of the steps taken and any configuration files modified.
Related categories:
Linux
Education
Nginx
Amazon Web Services
Node.js
Documentation
DevOps
System Administration