Load Balancer Listeners and Rules
What you'll learn: How load balancers receive and route incoming traffic using listeners and rules.
The Front Door Analogy
Think of a listener as a receptionist at a company's front desk. Each listener sits at a specific entrance (port) and speaks a specific language (protocol like HTTP or HTTPS). When visitors arrive, the receptionist checks their requests against a set of instructions (rules) to determine where they should go inside the building.
What Are Listeners?
A listener is a process that monitors a specific port and protocol combination on your load balancer. For example, you might configure:
- A listener on port
80for HTTP traffic - A listener on port
443for HTTPS traffic - A listener on port
8080for a custom application protocol
Each listener actively checks for incoming connection requests matching its port and protocol.
How Rules Work
Once a listener accepts a connection, rules determine what happens next. Rules are evaluated in priority order and specify:
- Conditions: What to match (host header, path patterns, HTTP methods)
- Actions: Where to route the traffic (which target group receives the request)
For example, an Application Load Balancer rule might say:
- "If the path starts with
/api, send to the API server target group" - "If the path starts with
/images, send to the media server target group" - "Everything else goes to the default web server target group"
Network Load Balancers use simpler rules since they operate at Layer 4 (just TCP/UDP), while Application Load Balancers can inspect HTTP/HTTPS content for advanced Layer 7 routing.
Key Takeaway: Listeners accept incoming traffic on specific ports and protocols, while rules determine how that traffic gets routed to your backend targets—together they form the "decision engine" of your load balancer.