mediumMultiple Choice
Health Check Endpoint Missing: Load Balancer Health Check Troubleshooting
Exhibit
Refer to the exhibit.
```
resource "aws_instance" "web" {
ami = "ami-12345678"
instance_type = "t2.micro"
subnet_id = "subnet-abc123"
vpc_security_group_ids = ["sg-xyz789"]
user_data = <<-EOF
#!/bin/bash
yum install -y httpd
service httpd start
EOF
}
resource "aws_lb_target_group" "web_tg" {
name = "web-tg"
port = 80
protocol = "HTTP"
vpc_id = "vpc-111111"
health_check {
path = "/health"
}
}
resource "aws_lb_listener" "web_listener" {
load_balancer_arn = aws_lb.web.arn
port = 80
default_action {
type = "forward"
target_group_arn = aws_lb_target_group.web_tg.arn
}
}
```A cloud engineer deployed the infrastructure shown. The load balancer's health checks are failing for the EC2 instance. Which of the following is the MOST likely cause?
Quick Answer
The answer is the missing health check endpoint /health on the web server. This is correct because the user_data script only installs and starts the httpd service but never creates the specific /health path that the load balancer is configured to probe. A load balancer health check failure due to missing endpoint occurs when the target responds on the port but returns a non-200 status code for the configured path, since the web server has no route or file at that location. On the CompTIA Cloud+ CV0-004 exam, this tests your understanding that health checks verify both service availability and endpoint logic, not just that the server is running. A common trap is assuming a running web server automatically passes all health checks, but the path must explicitly exist. Memory tip: “Health checks need a home—if the path isn’t there, the check will roam.”
⚠ Common exam trap
Many exam-takers assume a security group or subnet misconfiguration is the root cause, but the question specifically describes health checks failing (not timing out), which points to an application-layer issue like a missing endpoint rather than a network-layer problem.
Answer choices
Why each option matters
Answer the question above first, then reveal the full breakdown to understand why each option is right or wrong.
Correct answer & explanation
✓
The health check endpoint /health does not exist on the web server.
The health check is failing because the load balancer is configured to check the /health endpoint, but the web server does not have that endpoint defined. Without a matching route or file for /health, the server returns a non-2xx/3xx status code (e.g., 404 Not Found), causing the load balancer to mark the instance as unhealthy.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✗
The web server is not running HTTP.
Why it's wrong here
A stopped or non-listening web server would fail health checks, but this option misstates the cause: the check itself targets an HTTP port and path, so a server running HTTPS-only on that port returns no valid HTTP response. It would be correct where the listener genuinely serves plain HTTP on the checked port.
- ✓
The health check endpoint /health does not exist on the web server.
Why this is correct
Health checks probe a specific path and port; if /health is absent, the web server returns 404 or resets, marking the instance unhealthy despite the application running. This is the most likely cause, not security groups or instance state, which would produce different symptoms.
- ✗
The EC2 instance is in the wrong subnet.
Why it's wrong here
A subnet placement mismatch prevents the load balancer reaching the instance only when routing or availability zone alignment fails; the stem's diagram would depict that. Subnet errors are a plausible cause of unreachable targets, but health checks typically fail on port or protocol mismatches instead.
- ✗
The security group does not allow traffic from the load balancer.
Why it's wrong here
Security groups filter traffic by port and source; if the health check port or load balancer source is blocked, checks fail. This is tempting because security groups commonly cause connectivity faults, but the stem's diagram would show the load balancer and instance sharing a permitted path.
Go deeper
Related to this question
About these practice questions
This CV0-004 question is part of Courseiva's 834-question bank — original exam-style content with full explanations and wrong-answer analysis, never real exam questions or exam dumps. Learn why practice questions differ from exam dumps →
Same concept, more angles
1 more way this is tested on CV0-004
These questions test the same concept from different angles. Work through them to make sure you can recognise it however the exam phrases it.
Variation 1. Refer to the exhibit. A cloud load balancer is returning 502 Bad Gateway errors to clients. What is the most likely cause?
medium- A.The load balancer's SSL certificate is invalid.
- B.The security group allows inbound traffic from the load balancer.
- C.The DNS record points to the wrong IP.
- ✓ D.The backend web servers are not responding correctly.
Why D: A 502 Bad Gateway error indicates that the load balancer (acting as a proxy or gateway) received an invalid or no response from the upstream backend web servers. This typically occurs when the backend servers are overloaded, have crashed, or are misconfigured (e.g., incorrect health check path, application pool failure). The load balancer successfully forwards the request but fails to get a valid HTTP response, triggering the 502 error.
JA
Written by Johnson Ajibi, MSc IT Security
Senior Network & Security Engineer · founder of Courseiva
This CV0-004 practice question is part of Courseiva's free CompTIA certification practice question bank. Courseiva provides original exam-style practice questions with explanations, topic-based practice, mock exams, readiness tracking, and study analytics to help learners prepare for the CV0-004 exam.