Skip to content

Instantly share code, notes, and snippets.

@eksiscloud
Created April 22, 2020 16:41
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save eksiscloud/7d7b16ad6d94fa389b5fc5e0db70f5e7 to your computer and use it in GitHub Desktop.
Save eksiscloud/7d7b16ad6d94fa389b5fc5e0db70f5e7 to your computer and use it in GitHub Desktop.
Monit: Nginx
check process nginx with pidfile /var/run/nginx.pid
group www
group nginx
start program = "/etc/init.d/nginx start"
stop program = "/etc/init.d/nginx stop"
# if failed port 80 protocol http request "/" then restart ; I'm redirecting to 443 in Nginx, so no need to monitor
if 5 restarts with 5 cycles then timeout
depend nginx_bin
depend nginx_rc
check file nginx_bin with path /usr/sbin/nginx
group nginx
include /etc/monit/templates/rootbin
check file nginx_rc with path /etc/init.d/nginx
group nginx
include /etc/monit/templates/rootbin
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment