Forum Discussion
Jeff_Wyant_4852
Nimbostratus
Feb 03, 2011Route Traffic Based on Header Info
Problem: I need to route traffic coming into a single virtual server, inspect the header info, and if the condition matches, send it to another pool while leaving traffic that doesn't match ...
Chris_Miller
Altostratus
Feb 03, 2011This rule assumes you change "default" below to the pool you'd like non-matching traffic to use. Also, you'll want to use OneConnect to ensure the HTTP info is evaluated and traffic is sent accordingly.
More can be read about that here:
http://devcentral.f5.com/Tutorials/TechTips/tabid/63/articleType/ArticleView/articleId/114/OneConnect-For-my-iRule.aspx
Finally, you can either make a list of addresses in a "class/data group" and check whether they exist, or you can specify them from within the rule. How many addresses do you have total to check? that can influence whether you go one way or the other.
when HTTP_REQUEST {
if { [HTTP::header "X-Forwarded-For"] contains "64.238.106.226" } {
pool mysite }
else { pool default }
}
Recent Discussions
Related Content
DevCentral Quicklinks
* Getting Started on DevCentral
* Community Guidelines
* Community Terms of Use / EULA
* Community Ranking Explained
* Community Resources
* Contact the DevCentral Team
* Update MFA on account.f5.com
Discover DevCentral Connects