0

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?

1 Answer 1

1

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"

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.