I tried to mointor my nginx proxy in one VM with this config in

# cat /etc/monit/conf.d/nginx 
check process nginx with pidfile /run/nginx.pid
    start program = "/usr/sbin/service nginx start" with timeout 60 seconds
    stop program  = "/usr/sbin/service nginx stop"
    if failed host somedomain_here.org port 443 protocol http for 3 cycles then restart

But I only get these errors in /var/log/monit.log

error    : 'nginx' failed protocol test [HTTP] at [somedomain_here.org]:443 [TCP/IP] -- Connection refused  

although the domain has https. it seems like the proxy itself cannot access the sites that it proxies to other vms on the same host.

How can I monitor nginx?


You can check for the pid if nginx is still running with this config in /etc/monit/conf.d/nginx instead:

check process nginx with pidfile /var/run/nginx.pid
    start program = "/etc/init.d/nginx start"
    stop program = "/etc/init.d/nginx stop"

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.