Forum Discussion
andrew_deackes_
Feb 27, 2014Nimbostratus
ok, so thought I would achieve this with setting some datagroups to check for the source IP in the irule and then provide a different pac based on that. However, starting with the i-rule I was using I immediately ran into a problems, I tried setting the pac file contents like this:
when RULE_INIT {
set pacfile-india {
}
set pacfile-tunis {
}
set pacfile {
} } when HTTP_REQUEST {
switch -glob [string tolower [HTTP::uri]] {
"/proxy.pac" {
if {[class match -value -- [IP::client_addr] equals india-pac]} { HTTP::respond 200 content $::pacfile-india "Content-Type" "application/x-ns-proxy-autoconfig" "pragma" "no-cache"} elseif {[class match -value -- [IP::client_addr] equals india-pac]} { HTTP::respond 200 content $::pacfile-tunis "Content-Type" "application/x-ns-proxy-autoconfig" "pragma" "no-cache"} else { HTTP::respond 200 content $::pacfile "Content-Type" "application/x-ns-proxy-autoconfig" "pragma" "no-cache"}
}
}
}
but it's simply not working! I'm sure I have something basic wrong but can't see it myself, any clues welcome!! Please! :-)
A