Skip to content

Access EC2 via NLB/ALB sequence

0

I am following the instructions strictly -

  1. I verify that the ALB is accessed directly via HTTPS/443 - I get the response/page with two browesers, as intended.
  2. I create a TLS/443 listener on NLB.
  3. I create a target group to ALB tcp/443 - as instructed.

When looking at the setup, it seems that target group fails "Health Check"? Here is a report - Health check settings Protocol: HTTP - Unhealthy threshold: 3 consecutive health check failures Path: / - Timeout: 6 seconds Port: Traffic port – Interval: 30 seconds Healthy threshold:3 consecutive health check successes - Success codes: 200-399

What is going on? Thanks, Moti

asked 2 years ago322 views

1 Answer
0

The issue you're experiencing with the health check failing for your NLB to ALB setup is likely due to a mismatch in the health check configuration. When using an ALB as the target for an NLB, there are some specific considerations to keep in mind:

  1. For an NLB with an ALB as the target, the only supported protocol for the target group is TCP, not HTTP. Your health check is currently set to HTTP, which is not compatible with this setup.

  2. When configuring an ALB as the target of an NLB, you should use a TCP health check on the NLB's target group, not an HTTP health check. The NLB doesn't understand HTTP protocols and can't perform HTTP-level health checks.

  3. The NLB should have a TCP listener (not TLS) when the target is an ALB, even if you're using HTTPS. The TLS termination happens at the ALB level in this architecture.

To resolve this issue:

  1. Change the target group's health check protocol from HTTP to TCP.
  2. Remove the health check path ("/") as it's not applicable for TCP health checks.
  3. Ensure the NLB listener is set to TCP/443, not TLS/443.
  4. Keep the health check port as "traffic port" (443 in this case).

After making these changes, the health check should pass, and the NLB should be able to forward traffic to the ALB correctly. Remember, in this setup, the NLB is essentially acting as a transparent network proxy, passing the encrypted HTTPS traffic through to the ALB, where it will be decrypted and processed.
Sources
Using HTTPS with an NLB communicating securely via an ALB to the EC2 | AWS re:Post
Target Group - Only send traffic to healthy nodes | AWS re:Post

answered 2 years ago

EXPERT

reviewed 2 years ago

  • Your suggestions 1 and 2 (to resolve) are not accepted by the EDIT attempt for the ALB target group.

  • The health check should have been HTTPS and TCP!

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.