Routing based on request headers (using AWS Application Load Balancer)

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.


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.

  • Client calling https://example.com
  • ALB's DNS is configured to example.com
  • ALB has Target group attached to it which has nginx instances. Nginx instances routes to respective Load balancer with the header information. ( eg. if customerId is 123 route to ELB 1 else route to ELB 2 )
  • Two ELB has different EC2 instances attached to it.
  • 但听说AWS正在努力

    But heard AWS is working on routing request based on the headers.

    链接地址: http://www.djcxy.com/p/36228.html

    上一篇: 任务重命名文件?

    下一篇: 基于请求标头的路由(使用AWS Application Load Balancer)