A Layer 7 load balancer is more sophisticated and more powerful. It inspects packets, has access to HTTP and HTTPS headers, and (armed with more information) can do a more intelligent job of spreading the load out to the target.
https://aws.amazon.com/blogs/aws/new-aws-application-load-balancer/
I understand the AWS Application Load Balancer has access to the HTTP(S) request headers but I can only see how you can route via the path. Can someone explain how I can route based on the user-agent
header. If it's not possible, please suggest an alternative AWS method.
Test path-based routing To test this routing, copy the DNS name of your Application Load Balancer in a web browser and add the URL path /svcA or /svcB. When the Application Load Balancer listener receives the request, the listener forwards that request to the appropriate target group based on the path condition.
Application Load Balancer. An Application Load Balancer makes routing decisions at the application layer (HTTP/HTTPS), supports path-based routing, and can route requests to one or more ports on each container instance in your cluster.
Path-based routing is one of the unique features offered by Application Load Balancer. Path-based routing is also referred to as URL-based routing. The Application load balancer will forward the requests to the specific targets based on the Rules configured in the load balancer.
Till 2017-05-26 ALB doesn't have header based routing. With a update on 2017-04-05 it has included Host based routing. Currently it supports only path and host based routing. You can visit here for latest AWS information.
If you want to route based on headers ,currently there are no options in ALB. You have to have an additional layer either like a proxy / nginx servers. Flow can be something like this below.
But heard AWS is working on routing request based on the headers.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With