Forum Discussion
Sams_88783
Nimbostratus
Jan 25, 2012Irule help
We have 2 IIS servers and 2 Apache servers and we are looking for is a way to separate two types of traffic (IIS versus Apache) and send the traffic to different pools.while discarding everything else. It will probably make sense to create two variables; one to list the IIS URLs and the other to list the Apache URLs; as part of this as well.
I have created irule as below:
when HTTP_REQUEST {
if { [HTTP::host] equals "iistest.abc-hhc.com"} {
use pool iis_hosting_pool
}
else if {[HTTP::host] equals "apachetest.abc-hhc.com"} {
use pool apache_hosting_pool
}
else {
discard
}
}
But this is giving syntax error.There will be multiple URLs that will fall in to each category.In version 4.x there is a variable concept, but not finding in 9.x.
Please help urgent.
1 Reply
- Chris_Phillips
Nimbostratus
If you want to assign a pool based on the http uri, why not just use an httpclass profile? That's exactly what they are there for.
Also if you have a list of hosts, you wouldn't use a normal variable, you'd probably want to store them in data group lists and then use a class match operation to find a match. Plenty of examples around, such as this: http://devcentral.f5.com/Community/GroupDetails/tabid/1082223/asg/50/aft/1167433/showtab/groupforums/Default.aspx
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
