muzammil_88686
Nov 28, 2012Nimbostratus
iRule - Source Address and "X-Forwarded For"
Currently we are using the below iRule which is chekcing the "X-Forwarded-For" in HTTP header and 10.0.0.0/16 source address
===
when HTTP_REQUEST {
if {([HTTP::header exists "X-Forwarded-For"]) and ([string tolower [HTTP::uri]] contains "/wf/hp.me")} {
switch -glob [HTTP::header values "X-Forwarded-For"] {
"10.0*" {
HTTP::redirect "http://www.test.com/WF/H.me"
pool Pool2
return
}
}
}
if {[string tolower [HTTP::path]] starts_with "/wf"} {
pool Pool2
}
}
===
Apart from the above exising environmet, now we want to add "X-Forwarded-For" in HTTP header and 10.3.0.0/16 source address and need to redirect the URL from "http://www.test.com/WF" to "http://www.test.com/WF?sr=new"
Could you pls let me know how can I merge this new requirement with the existing iRule?
Also could you pls let me know if the new proposed iRule can be feasible to accomodate this kind of requests in future?