I had two EC2 web instances responding when I opened their addresses directly, but the request through my Application Load Balancer (ALB) was not behaving as expected. I initially focused on the application. The useful step was to trace the request path one layer at a time.
In my personal learning lab, I corrected the security-group routing, forwarded traffic through a target group, and added a listener rule for /error that returned a fixed response. The exercise helped me see that the listener, target group and security groups answer different questions.
Figure 1 — A simplified HTTP request path. The /error example returns from the listener rule; the other path is forwarded to a target group.
Follow the request in order
| Layer | Question I checked | What it does |
|---|---|---|
| Listener | Is the request arriving on a protocol and port the ALB listens on? | Accepts connections and evaluates the listener’s rules. |
| Listener rule | Does the path match /error or another condition? |
Performs a routing action such as fixed-response or forward. |
| Target group | If forwarded, which registered targets are eligible? | Groups targets and applies configured health checks. |
| Security groups | Can traffic pass between the client, ALB and targets on the needed ports? | Permit or block network traffic at each attached resource. |
An ALB rule can return a fixed response directly, or forward a matching request to a target group. A fixed response is useful for a small diagnostic route: it lets me check that the listener and path rule match without needing an application response from a target. It does not prove that the target group or application works.
For a forwarded request, the target group is the next place to inspect. AWS documents that targets must be registered, referenced by a listener rule and pass their initial health checks before they receive requests. A green browser response from a fixed-response rule is therefore not a health check for the backend.
What the lab taught me
My lab had two EC2 web instances that I could reach directly. I then put an ALB in front of them and configured a target group. When the ALB path failed, the security-group configuration was one part of the route that needed correction. After that, I used a fixed response on /error to make the listener-rule behaviour visible.
That gave me two separate checks:
- Does the listener match and take the intended action? The
/errorfixed response was a simple way to observe this branch. - Can the ALB forward to a healthy target? For this branch, I needed the target group and network permissions to line up as well.
For a real deployment, the target security group can allow the application and health-check ports from the ALB security group, rather than opening those ports to every client. The exact rules depend on the listener, target and health-check configuration. I would inspect the effective rules and target health before changing anything.
A repeatable lab checklist
The following is a suggested repeat exercise, not a claim that I ran every step below exactly as written:
- Create two small web targets in a test environment and confirm each target responds directly.
- Create an HTTP target group, register the targets and verify their health-check settings.
- Create an ALB listener and a forward rule for the target group.
- Set the ALB security group to allow the intended client traffic; allow target traffic from the ALB security group on the application and health-check ports.
- Add a higher-priority path rule for
/errorwith a fixed response and a short diagnostic body. - Test
/errorand a normal application path separately. Check the target group’s health and the ALB’s listener rules if the results differ. - Remove lab resources when finished and confirm that no chargeable resources remain.
What I verified—and what I did not
I completed the ALB portion of my course lab, corrected security-group routing and observed the /error fixed response. I did not verify cleanup of every lab resource in the learning record. I have not tested this design under production traffic or established availability, security or cost characteristics for a production service.
The useful lesson was not simply “add a load balancer”. It was to separate request matching, backend selection and health, and network permission. That makes troubleshooting more systematic: verify each boundary instead of changing the application before knowing where the request stopped.
Takeaway
When an ALB request fails, trace it from listener to rule to target group, then check the relevant security-group path. A fixed response can isolate listener behaviour, but it cannot tell me whether the backend is healthy.
References
- AWS: Listener rules for an Application Load Balancer
- AWS: Action types for listener rules
- AWS: Health checks for Application Load Balancer target groups
- AWS: Security groups for an Application Load Balancer
This post describes a personal learning lab, not production implementation experience. AWS behaviour and console steps can change; check the current documentation before applying a design.