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?