A SysOps administrator is troubleshooting an issue with an Application Load Balancer (ALB). The ALB routes traffic to a fleet of Amazon EC2 instances running a web application on port 8080. In the AWS Management Console, all instances in the target group are marked as unhealthy with the status reason code 'Health.ResponseMismatch'. When analyzing the application logs on the EC2 instances, the administrator observes that incoming health check requests to the '/healthz' path are returning a '401 Unauthorized' status code because a global authentication middleware is applied. Which of the following actions should the administrator take to resolve this health check issue? (Select two.)
- Modify the web application configuration to bypass the authentication middleware for the '/healthz' path.Cevap
- Configure the target group's health check settings to include '401' in the success codes list.Cevap
- CUpdate the target group's health check configuration to use HTTP port 80 instead of the traffic-port.
- DChange the health check protocol to HTTPS to encrypt the request and bypass authentication.
- EConfigure an active-passive Route 53 failover routing policy to route health checks directly to the EC2 instances.
Cevap
To resolve the health check failure, the administrator must either modify the web application configuration to bypass the authentication middleware for the '/healthz' path, or configure the target group's health check settings to include '401' in the success codes list.
The correct responses are to modify the web application configuration to bypass the authentication middleware for the '/healthz' path, and to configure the target group's health check settings to include '401' in the success codes list. By default, Application Load Balancers expect a 200 OK status code. Since the application blocks unauthorized requests with a 401 status code, the ALB marks the targets as unhealthy due to a response mismatch. Bypassing authentication for the health check endpoint restores the expected 200 OK response. Alternatively, configuring the ALB target group to accept 401 as a success code allows the health checks to pass despite the authentication block.
Adım Adım Çözüm
Anahtar Kavram
Handling Application Load Balancer health check status code mismatches by either aligning application response codes or load balancer success code expectations.