Community Articles
Freeform articles, written by members of the community.
cancel
Showing results for 
Search instead for 
Did you mean: 
Daniel_Wolf
Nacreous
Nacreous

Many of us are well-versed in setting up Layer 7 Content Switching, based on an URL Path or based on the Host header, with iRules or with LTM Local Traffic Policies. Now I have been tasked to setup Layer 7 Content Switching based on the Host header with F5 XC (Distributed Cloud Services).

For those who are not familiar with the content, I will briefly illustrate what Layer 7 Content Switching is.
With Layer 7 Content Switching, also called L7 Routing, your loadbalancer will make a loadbalancing decission based on an information that is available at the application layer. That information can be for example the Host header or a part of the URL. Based on this information a routing decission will be made and a certain backend (or origin server) will selected.

hostname-based-l7routing.png

 Now in BIG-IP this can be achieved fairly easy by the means of iRules or LTPs. In F5 XC this can be achieved by using Routes. I created the required Routes object in the HTTP Load Balancer object. You will have to provide a Name for the Routes object and configure the Routes.

The important part is the matching section of the configuration. In my example I will match for ANY HTTP method, for any URL path that has the prefix / - means again anything. And, most important, I will configure Headers to match with the Match Value demo01.mydomain.com for the header name Host. This will then be routed to the Origin Pool serving the contents for demo01.mydomain.com.
I configured the same again with the required values for demo02.mydomain.com.

hostname-based-l7routing-match.pngImportant is that you have both domains configured on your HTTP Load Balancer object as well.

host-based-routing3 - Copy.png

 

 Enjoy your working setup. Extract from the metrics:

demo01.mydomain.com

hostname-based-l7routing-metrics3.png

demo02.mydomain.com

hostname-based-l7routing-metrics2.pngOverall view

hostname-based-l7routing-metrics1.png

Comments

Nice !

Version history
Last update:
‎09-Dec-2022 12:29
Updated by:
Contributors