title: Node JS auto restart all forever JS process when server goes down / crashes
body: <p>I am using forever js to keep my node server running 24/7 on AWS EC2.</p>
  
  <p>I use this command</p>
  
  <pre><code>forever start index.js
  </code></pre>
  
  <p>However, I notice that some time it randomly stops the process and my site goes down. I have to manually ssh into my server to run it again by doing:</p>
  
  <pre><code>forever restartall
  </code></pre>
  
  <p>And then it goes backup. Is there any way by which I can define a timeout, lets say if the server/website does not respond for 200 in 5 sec, then restart all forever process automatically?</p>
  
  <p>I am new to this, if any one can give me step by step example for my case, it would be awesome.</p>