Forum Discussion
hooleylist
Jun 08, 2012Cirrostratus
Hi Keith,
Did you have a question about the iRule you posted?
You could modify it to use a switch statement to avoid running string tolower on the URI multiple times:
when HTTP_REQUEST {
HTTP::header insert "X_CLIENT_IP" [IP::client_addr]
HTTP::header insert "X-Forwarded-For" [IP::client_addr]
switch -glob [string tolower [HTTP::uri]] {
"*/pmcserver/checkforwork*" {
pool pm2_qa_web
}
"*pmcserver*" {
pool pm2_qa_pmcserver
}
"/partner*" {
pool pm2_qa_soap
}
default {
pool pm2_qa_web
}
}
}
Aaron