Forum Discussion
Luca_55898
Jul 05, 2011Nimbostratus
Using an iRule for a proxy pac file
Trying to get an iRule working to deploy a proxy pac file.
I have been reading this link http://devcentral.f5.com/wiki/default.aspx/iRules/Proxy_Pacfile_Hosting_without_need_for_Web_servers.htm...
Luca_55898
Jul 05, 2011Nimbostratus
Thanks for the reply.
The issue i'm having is that the iRule does not seem to send the proxy server for external sites. So when I assign the VIP to a clients browser they can't access the web. Internal sites work fine so that side of things looks to be working.
The iRule now looks like this (i removed the dnsDomainIs sections)
Note - the proxy that this iRule should return is another VIP on the same LTM, is that OK?
when RULE_INIT {
set static::pacfile {
function FindProxyForURL(url, host) {
if (isPlainHostName(host))
return "DIRECT";
if (host.substring(0,3)=="10.")
return "DIRECT";
if (shExpMatch(url,"*.messages.*") ||
shExpMatch(url,"*remote.ourbusiness.com.au*") ||
shExpMatch(url,"*ww.ourbusiness.com.au*"))
shExpMatch(url,"*gobusiness.*") ||
shExpMatch(url,"*firstcust.*") ||
shExpMatch(url,"*longday.*") ||
shExpMatch(url,"*rosshome.*") ||
shExpMatch(url,"*ourbusiness.com*") ||
shExpMatch(url,"*portal.ourbusiness.com.au*") ||
shExpMatch(url,"*ourbusiness.com.au*") ||
shExpMatch(url,"*w2.ourbusiness.com.au*") ||
shExpMatch(url,"*w3.ourbusiness.com.au*") ||
shExpMatch(url,"*msgpooled.com*") ||
shExpMatch(url,"*corporateorders.com*") ||
shExpMatch(url,"*generic.com.au*") ||
shExpMatch(url,"*.ecommerce.com*") ||
shExpMatch(url,"*.paymentpage.com*") ||
shExpMatch(url,"*.mpt.com.*") ||
shExpMatch(url,"*.customercentral.com*") ||
shExpMatch(url,"*.informatic.com*"))
return "DIRECT";
return "PROXY proxy1.ourbusiness.com:3128";
}
}
}
when HTTP_REQUEST {
switch [HTTP::uri] {
"/proxy.pac" {
HTTP::respond 200 content $static::pacfile "Content-Type" "application/x-ns-proxy-autoconfig" "pragma" "no-cache"
}
}
}
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