Fix Load Balancer Health Check Failing — Targets Unhealthy

Direct answer

Load balancer health checks fail when the target instance does not return HTTP 200 on the configured health check path and port. Verify the health endpoint is responding, the port matches the application listener, and security groups allow traffic from the load balancer.

Structured breakdown

Cause

Unhealthy targets mean the health check endpoint isn't responding correctly. Verify the health check path returns HTTP 200, the correct port is configured, and the application starts before the first check.

Fix

  • Verify the health check endpoint returns HTTP 200 by curling it from the instance
  • Match the health check port and path to what the application is actually serving
  • Increase the health check grace period or initial delay for slow-starting apps

Outcome

All targets register as healthy and the load balancer distributes traffic normally.

Common causes

  • Health check path returns non-200 status code
  • Health check port doesn't match the application's listening port
  • Application takes too long to start — fails initial health checks
  • Security group or firewall blocks health check traffic from the LB
  • Application crashes intermittently, failing checks during restarts

Fix steps

  1. 1

    Verify the health check endpoint returns HTTP 200 by curling it from the instance

  2. 2

    Match the health check port and path to what the application is actually serving

  3. 3

    Increase the health check grace period or initial delay for slow-starting apps

  4. 4

    Check security groups to ensure the LB's IP range can reach the target port

  5. 5

    Add a dedicated /health endpoint that returns 200 without heavy computation

Analyze this issue

Paste the issue description, logs, or symptoms into the fix tool to inspect this problem with your own runtime details.

kintify fix

Need more context?

If the standard steps do not resolve the issue, open the fix tool and include the current logs, configuration, and deployment changes.

Open Fix Tool

Frequently asked questions

These examples show the commands, logs, and configuration patterns most often used to verify this issue.

Command examples

  • curl -v http://localhost:8080/health
  • aws elbv2 describe-target-health --target-group-arn <arn>
  • ss -tlnp | grep 8080

Log snippet

Health check failed: target group arn:aws:elasticloadbalancing:...
Target id: i-0abc123
Reason: Health checks failed with these codes: [502]

Config snippet

HealthCheck:
  Path: /health
  Port: 8080
  Protocol: HTTP
  HealthyThresholdCount: 2
  UnhealthyThresholdCount: 3
  IntervalSeconds: 15