Forum Discussion
Syntax to Map Virtual-Server's Character with Data-Group which Contains Pool Name
I guess I complicated matters by trying to simplify them. The intent was to consolidate the pools into a single data group, so that you didn't have to manage TWO data groups for the same virtual server.
So going back to using TWO data groups, this is what the iRule should look like:
when HTTP_REQUEST {
switch -glob [ HTTP::uri] {
"/" {
log local0. "redirecting from /"
HTTP::redirect "https://www.parveez.com"
return
pool pool_parveez.com-http
}
"/iss_static*" {
if { [class match [virtual] equals dg_parveez_static_pools] } {
pool [class match -value [virtual] equals dg_parveez_static_pools]
} else {
log local0. "Static pool entry for [virtual] not created yet"
reject
}
return
}
default {
if { [class match [virtual] equals dg_parveez_dynamic_pools] } {
pool [class match -value [virtual] equals dg_parveez_dynamic_pools]
} else {
log local0. "Dynamic pool entry for [virtual] not created yet"
reject
}
return
}
}
}
also when someone type HTTP, it should redirect to HTTPS
If all traffic must be HTTPS, then you should put this iRule and pools on an HTTPS VIP, create a separate HTTP (port 80) VIP, and then just apply the built-in "_sys_https_redirect" iRule to that VIP. It will redirect all requests to it to the same HOST/URI on HTTPS.
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