I am trying to set up my application server behind the Amazon Elastic Load Balancer. I am thinking to have one server dedicated for old version, and all other server dedicated for new version. I am thinking to implement this using version id in path parameter
e.g.
Current Version (3.0) : http://example.com/APPNAME/service
Old Version (2.2) : http://example.com/APPNAME/v2.2/service
I would like to know:
- Does ELB has ability to look into HTTP request?
- Can ELB redirect request depending on the URL Path Parameter?
Update 2017-04-05
After launching the new Application Load Balancer with path-based routing support last summer (see preceding update), AWS has now also added Host-Based Routing Support for AWS Application Load Balancers:
Update 2016-08-11
AWS has just (Aug 11, 2016) launched a new Application Load Balancer for the Elastic Load Balancing service, which is designed to improve flexibility and performance of real-time applications, microservices, container-based architectures, and streaming applications:
As emphasized in the introductory blog post, this new Application Load Balancer option for ELB […] runs at Layer 7 and supports a number of advanced features [whereras] the original option (now called a Classic Load Balancer) is still available to you and continues to offer Layer 4 and Layer 7 functionality.
More specifically ELB now supports the scenario at hand, because each Application Load Balancer allows you to define up to 10 URL-based rules to route requests to target groups (AWS plans to give you access to other routing methods over time).
Initial Answer
This is not possible – Amazon ELB mainly (but see below) provides Transport-layer load balancing (OSI layer 4), which bases its load balancing decisions solely on the TCP connection but ignores the application payload. The latter would allow Application-layer load balancing (OSI layer 7), where the application payload is taken into account for the load balancing decisions indeed.
The default configuration in Amazon ELB actually provides basic application level support for HTTP/HTTPS/SSL (e.g. terminating SSL connections and inserting
X-Forwarded-*headers), but you cannot adjust this configuration; put another way, ELB does look into the HTTP request here indeed, but you have no control over the ELB behavior n this regard.This is explained in more detail within Choosing Listeners for Your Load Balancer, e.g.:
The Architectural Overview provides an illustration and more details as well.