I am trying to implement health checks, but I’m not sure what port/path to use. I have a stack that runs a Node/Express server on port 3000. I also have an API that is running Nginx+PHP FPM sidekick. Nginx listens on port 80 and PHP is on 9000. I have a Rancher load balancer that does SSL termination for these services. The load balancer listens on port 443 for example.com and forwards it to the Node server on port 3000. It also listens on port 443 for api.example.com and forwards to the Nginx server on port 80.
I’d like to setup health checks for each of these services, but I’m not sure what to use for the config. For the Node server health check, do I use port 3000, since that is what the Node service exposes? Or do I use port 443 because the load balancer is in front of the Node server listening on that port? Same question for my Nginx/PHP service. Do I use port 80 there since that’s where Nginx listens or port 443, since the load balancer accepts traffic there and forwards to port 80?
Also, if the Node server health check should be on port 3000 and the Nginx should be on 80, how do I handle health checks on the PHP FPM server (port 9000)? Since Nginx is in front of PHP, what would I use for health checks there?
Any advice would be appreciated. Thanks!