Forum Discussion
Initiating Access Policy from iRules
Currently there's no way to dynamically switch between access policies in a single VIP. The ACCESS::policy evaluate command will indeed allow you to assign an access policy to a given request, but it does so in a limited fashion and is not really intended for HTTP traffic. Probably the best way to switch between policies based on the URL is simply to layer an LTM VIP over individual APM VIPs. Create your APM VIPs on port 80 with internal (non-routable) addressed. Create a single external LTM VIP with your publicly-accessible IP, client SSL profile (if required), and an iRule like this:
when HTTP_REQUEST {
switch [string tolower [HTTP::host]] {
"www1.domain.com" { virtual apm1_vs }
"www2.domain.com" { virtual apm2_vs }
}
}
where the virtual command forwards the request internally to the named VIP.
Help guide the future of your DevCentral Community!
What tools do you use to collaborate? (1min - anonymous)Recent Discussions
Related Content
* 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