I have an ALB and a target group pointing to my EC2 instance running apache2 on Centos 7. the healthcheck path by default is pointing to ‘/’
If i create a default website in virtualhosts, everything works as the Healthcheck’s status is ‘Healthy’; but if I want to turn off the default site and only have certain URLs available, what should I change the default path to? I’ve tried various paths and the status always seems to go to "unhealthy"
2
Answers
I logged a ticket with AWS who have responded with:
"Unfortunately, at the moment it is not possible to perform health checks based on host headers for any Elastic Load Balancer (ALB, CLB or NLB). However, there is already an existing feature request for this type of configuration"
My workaround was to create a default site in VirtualHosts. On my Centos 7 server I have updated file:
/etc/httpd/vhosts.d/myweb.conf
I added:
and then created the file
/var/www/html/healthcheck/index.html
so the healthcheck responds a 200 success.
I hope they update this soon and add ability to pass a health check via domain name and not just port or /healthcheck.html. I think I may have gotten around this problem on Windows EC2 by opening a port 8088. Try this:
One outstanding issue I have with this setup which I am investigating is that domain that I pointed to EC2 IP example.com is not loading the "health-check" site by going to example.com:8088 – please post your suggestions. Cheers