Forum Discussion
andrew_deackes_
Nimbostratus
Feb 25, 2014pac file i-rule with variable proxy?
Hi,
I found this article very interesting:
https://devcentral.f5.com/wiki/irules.Proxy_Pacfile_Hosting_without_need_for_Web_servers.ashx
however I'd like to do something slightly more ...
andrew_deackes_
Nimbostratus
Feb 27, 2014ok, 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
Help guide the future of your DevCentral Community!
What tools do you use to collaborate? (1min - anonymous)Recent Discussions
Related Content
DevCentral Quicklinks
* 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
Discover DevCentral Connects