I use a VM scale set for my node application. My app has an action which is public accessible via www.mydomain.com/api/healthcheck
and prints just some json.
When I configure my health probe to use TCP
protocol, everything works fine and also my api returns me the expected json (and status 200).
However, when I now switch my health probe to use HTTP
and path=/api/healthcheck
, my website isn't accesible anymore (ERR_CONNECTION_TIMED_OUT
... I guess the loadbalancer takes out all instances because the health probe tells him that every instance is unhealthy)
I use nginx in front of my node app, but I also tried (for testing) to configure my LoadBalancer to route port 80 to backendport 8080 (where my node app is running on every machine, so I can avoid nginx proxy). But I get the same behaviour.
I'm out of ideas why my custom health check doesn't work. Hope you can help.
Edit: For testing, I did the following:
tcp
mydoamin.com:3000/hello
is available (prints hello and returns 200)http
-protocol, port 3000
and location /hello
.I can't see your server's code so its hard to figure out. If you shared some code it would be easier.
So lets try to analyze the situation :
Connection to the instances has timed out
Try to perform the following command from your machines terminal
curl –I private-IP-address-of-the-instance:port/health-check-target-page
now depending on the otucome we have different possible causes...
Problem: The security group for the instance is blocking the traffic from the load balancer.
Do a packet capture on the instance to verify the issue. Use the following command:
tcpdump port health-check-port
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With