skip to Main Content

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


  1. Chosen as BEST ANSWER

    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:

    <VirtualHost *:80>
        DocumentRoot /var/www/html/healthcheck
        ServerName  healthcheck
        ServerAlias *
    </VirtualHost>
    

    and then created the file

    /var/www/html/healthcheck/index.html

    so the healthcheck responds a 200 success.


  2. 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:

    1. enable listener on load balancer on port 8088
    2. on target group change health check to custom port 8088
    3. on EC2’s security group allow HTTP traffic on port 8088 Ip4 and Ip6
    4. create new website on EC2 IIS "health-check" and set binding for port 8088 using HTTP and blank hostname
    5. on EC2 run this PowerShell command: netsh advfirewall firewall add rule name="Open Port 8088" dir=in action=allow protocol=TCP localport=8088
    6. using nMap confirm that 8088 is open: Discovered open port 8088/tcp on #.#.#.#
    7. on target group only add one target either using port 80/443, do not add target on port 8088 🙂
    8. on target group confirm that you see healthy – This target is currently passing target group’s health checks.

    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

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search