Soru

Zorluk: OrtaElastic Load Balancing Health Checks and Troubleshooting

An Application Load Balancer (ALB) is configured to route HTTP traffic on port 80 to a target group containing Amazon EC2 instances. The EC2 instances run a web application that automatically redirects all incoming HTTP requests to HTTPS (HTTP 301) to enforce encryption. The target group health checks are configured to use HTTP on the traffic port with the path `/`. The load balancer registers all EC2 instances as unhealthy. Which TWO actions should a SysOps administrator take to resolve this health check issue? (Select TWO.)

  1. Modify the target group's health check settings to include 301 in the Success codes (Matcher) range.Cevap
  2. Configure the web server on the EC2 instances to return an HTTP 200 OK status code directly for health check requests without redirecting them to HTTPS.Cevap
  3. C
    Configure the target group's health check protocol to HTTPS and set the health check port to 443.
  4. D
    Associate a Route 53 Active-Passive failover routing policy to route the load balancer health checks to a backup target group.
  5. E
    Modify the stateless Network Access Control List (NACL) of the subnet to allow outbound ephemeral ports.

Cevap

Modify the target group's health check settings to include 301 in the Success codes (Matcher) range, and configure the web server on the EC2 instances to return an HTTP 200 OK status code directly for the health check requests without redirecting them.
The correct responses involve updating the target group's Success codes (Matcher) to include 301, or configuring the web server to respond with 200 OK for health check paths without redirecting. This directly addresses the application's redirect behavior causing the default health check validation to fail.

Adım Adım Çözüm

1
Analyze the health check failure reason.
The target instances are marked unhealthy because they redirect HTTP requests on port 80 to HTTPS (HTTP 301), while the ALB health check expects a default response code of 200 OK.
Understanding the mismatch between the load balancer's default expectation (200 OK) and the server's redirect response (301) isolates the root cause.
2
Configure the target group to accept redirection status codes.
By updating the Success codes (Matcher) range to include 301, the ALB will accept the redirect response as a healthy state.
This allows the ALB to receive the 301 redirect code and still classify the target instance as operational.
3
Alternatively, adjust the web server behavior on the backend instances.
The web server is configured to respond with HTTP 200 OK directly for health check requests before redirecting traffic to HTTPS.
This satisfies the load balancer's default health check parameters without requiring modifications to the target group configuration.

Anahtar Kavram

Application Load Balancer health checks require the target instances to respond with status codes that match the configured Matcher (default 200). If the instance redirects traffic (HTTP 301/302), the matcher must be updated, or the instance must bypass the redirect for health checks.
Bu soruyu puanla