0

In Monit, how can I check the health of my Nginx server (if it is returning 502, for example) and how to restart it when this occurs.

The environment is an Ubuntu 14.04 64bit

Paulo Coghi
  • 588
  • 1
  • 11
  • 22

1 Answers1

1

Install a higher version of monit using this:

Install Latest Version of Monit on Ubuntu 14.04 LTS Server 64bit(x86_64) | gist.github.com

Then add something like this:

if failed
    port 443
    protocol http
    request /
    status != 200
    with timeout 30 seconds
    then restart
Chiedo
  • 136
  • 2