I have a single ubuntu ec2 instance running nginx behind an ELB. Occasionally the instance runs out of memory which crashes the node app behind nginx and then I get a 502 bad gateway message and have to reboot.
I can see how to get alarm messages that this has happened, and can set the ELB health check to fail if there is a 502, but is it possible to have the instance reboot automatically?
In the EC2 dashboard I see where I can tell it to reboot if the Instance Status Check fails, but I don't think this can be configured to do what I want - the ELB health check is not the same as the Instance Health Check. It seems like somehow I need to connect the two.
I am not using auto scaling.