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
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
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