Search code examples
amazon-web-servicesamazon-elbaws-application-load-balancer

is it possible to achieve path based routing behind aws NLB?


I have a use case:- where my I have a lot of traffic coming to my webservers so I need greater performs and better latency however there are 2 paths to which traffic is incoming.

as per my understanding this is achievable with aws NLB which scales to 1000's request per second and 100 ms sub latency.

however I have www.jatin.com and www.jatin.com/somepath which means It needs path based routing which Is supported by aws ALB.

I need performance as well as path based routing achievable with NLB?


Solution

  • achievable with NLB?

    Sadly its not possible. Concepts of url, paths or dns hostnames are only defined for Layer 7 - Application of the OSI model. However, NLB operates at layer 4 - transport. Subsequently, NLB is not able to differentiate between any url domain names or paths.

    The only distribution of incoming traffic you can obtained for NLB, is based on port number, as per my knowledge. So you can have one listener for port 80, other listener for port 88, 443 and so on. This will work because ports, just like IP addresses, are part of layer 4.

    Only ALB operates at layer 7 and partially CLB, thus it can do path based routing. So you either have to use ALB, or maybe try to look for a third party load balancer which you can deploy on AWS.