Forum Discussion
APM Irule multiple access profile for one virtual server
Maybe a bit simplistic, but perhaps something like this will work:
when HTTP_REQUEST {
if { [class match [string tolower [HTTP::uri]] starts_with my_app_dg] } {
virtual [class match -value [string tolower [HTTP::uri]] starts_with my_app_dg]
} elseif { [HTTP::cookie exists MRHSession] } {
if { [class match [ACCESS::session data get -sid [HTTP::cookie value MRHSession] session.server.landinguri] starts_with my_app_dg] } {
virtual [class match -value [ACCESS::session data get -sid [HTTP::cookie value MRHSession] session.server.landinguri] starts_with my_app_dg]
}
}
}
where "my_app_dg" is a string-based data group that lists the application URI and corresponding internal VIP. Example:
/app1 := app1-internal
/app2 := app2-internal
If the request URI starts with one of the defined app URIs, VIP target to that. Otherwise, if the MRHSession cookie exists, look at the session.server.landinguri session variable to determine what the original path was, look that up in the data group, and VIP target accordingly. I didn't put any logic in the above to account for non-matching URI requests (an else statement), but that should be pretty straight forward. In my testing I created an external 443 LTM VIP with this iRule and 2 internal port 80 APM VIPs (though port doesn't really matter).
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