What are the requirements for successful health check?

Can we run a script on the webservers that returns HTTP 200 if the server is properly configured, and HTTP 5xx if something is wrong, so the loadbalancer will take it out?

Submit an answer

This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

Sign In or Sign Up to Answer

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Want to learn more? Join the DigitalOcean Community!

Join our DigitalOcean community of over a million developers for free! Get help and share knowledge in Q&A, subscribe to topics of interest, and get courses and tools that will help you grow as a developer and scale your project or business.

This comment has been deleted

This is written in the official tutorial:

Health Checks ensure that Droplets are available. By default, they test endpoints every 10 seconds. The health check for our forwarding rule will ping each Droplet’s web server on port 80, and if the server fails to respond after three tries, it will be removed from rotation. The Load Balancer will continue to ping the server, and once it has successfully received a response 5 consecutive times, the server will be returned to the pool.

So I would guess that’s kind of a no, but you can run a cronjob script every minute that will close your port 80 or remove the server from the LB group or something else. It’s not perfect, but maybe you should suggest it on UserVoice: