Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

AWS Application ELB Target Group Unhealthy 403?

I am trying to figure out why my ELB Target Group is not passing the health check and throwing a 403 (Forbidden) error. Details are:

  • AWS Windows 10 Server
  • WampServer3 for Apache, PHP, and MySQL
  • Application Elastic Load Balancer

I have my ALB Target Group Health Check Setup like so

  • Protocol: HTTP
  • Path: /folder1/folder2/public/index.php
  • Port: traffic port
  • Default threshold and timeouts

In my Security Group I have port 80, 443, and 22 open for inbound traffic.

Because it is throwing a 403 (Forbidden) error, I have to assume that the health check "Path" is not setup correctly.

I am using wamp so my default path is c:/wamp64/www so naturally I first set up my path to be directed to the homepage of my website (which I am able to access from the web just fine) but the health check still fails and shows the 403 error.

I even tried entering a path that doesn't exist to see if it would throw a different error but it just shows the 403 when hovering over the "i" next to the unhealth tag so I am not even sure the health check is updating.

Edit

Ok, after going through the resource that was given below, I have successfully pulled the "PrivateIP/index.php" page in cURL.

I have changed my Target Group Health Check Path to "/index.php" but it is still throwing the 403 error.

I am even able to access the homepage of my website publicly from the PrivateIP which seems unsafe but makes me wonder why it is still failing. Below is my setting to allow this in the httpd-vhosts.conf file.

<VirtualHost *:80>
ServerName website.com
ServerAlias xx.xx.xxx.xxx
DocumentRoot c:/wamp64/www/x/x/public/
<Directory  "c:/wamp64/www/x/x/public/">
    Options +Indexes +Includes +FollowSymLinks +MultiViews
    AllowOverride All
    Require all granted
</Directory>

The server alias is the private IP set by the Elastic IP on my instance.

If anyone has an idea on what to check next please let me know.

like image 418
Matthew Avatar asked Sep 07 '25 02:09

Matthew


1 Answers

You can resolve this failed health status issue by adding a index.html file on your default wamp path and then check your instance health status in your target group and configure your heath checks in target group just like the below one:

Protocol:HTTP
Path:/
Port:80

File location: c:/wamp64/www/html/

like image 79
asmath Avatar answered Sep 10 '25 20:09

asmath