Why are health checks failing when SSL/HTTPS is enforced?
Last updated: April 29, 2025
Context
When enabling health checks for a web application that enforces SSL/HTTPS for all requests, the application deployment may fail because the health check endpoint is not accessible. This commonly occurs in Rails applications or other frameworks that force SSL usage.
Answer
Health checks are performed from inside your cluster using HTTP protocol, not HTTPS. If your application forces all traffic to use HTTPS, it will block these internal health check requests, causing the deployment to fail.
To resolve this issue in a Rails application, you need to modify your code to allow HTTP requests specifically for health check endpoints while maintaining HTTPS enforcement for all other routes.
The health check requests only come from within your cluster, so this exception doesn't compromise your application's security.