Forum Discussion
iRule cannot fetch iFile (wpad.dat)
Just guessing, Suspecting issue with external data source
hxxp://x.x.x.x/MDD/wpad.dat
.
In this case iRule iFile is searching details inside F5 directory
/config/filestore/files_d/Common_d/ifile_d
Can you import wpad.dat file in F5 and run @AMG's iRule.
System > File Management--> iFile List --> Import
Hope will work...
Cheers...
- ciscozest_30697Aug 06, 2018Nimbostratus
Hi AMG and F5_Rock. Thanks for your support. I have checked the iFile exist and the Iruel scan be saved after validating the file path so it could be iFile content is not correct. Below is the brief content of wpad.dat file. Do you see any invalid parameters which could cause fetching issue?
function FindProxyForURL(url, host) {
// Send via proxy if (shExpMatch(url, "http://news.com.au/") || shExpMatch(host,"optus.com.au") ) return "PROXY webproxy.test-domain.com:8080";
// Send direct if (shExpMatch(host,".yahoo.com") || shExpMatch(host,".telstra.com") || shExpMatch(host,"*.weather.com.au") ) return "DIRECT";
// DEFAULT RULE: All other requests, send via proxy return "PROXY webproxy.test-domain.com:8080"; }
regards, Rob
- Andy_McGrathAug 07, 2018Cumulonimbus
Should be no issue with the iFile as simply plain text.
Is the iFile and the Virtual Server you are assigning the iRule to in the same partition, i.e. both in partition named 'MDD'?
If you try the following, removing the partition reference:
when HTTP_REQUEST { switch -glob [string tolower [HTTP:uri]] { "/mdd/wpad.dat" { HTTP::respond 200 contain [ifile get wpad.dat] "Content-Type" "application/x-ns-proxy-autoconfig" "pragma" "no-cache" } default { HTTP::respond 404 content "You've asked for something we don't have." } } }
Failing this can you run the folllowing and share the output:
tmsh list sys file ifile /MDD/wpad.dat tmsh list ltm ifile /MDD/wpad.dat
- ciscozest_30697Aug 10, 2018Nimbostratus
I managed to fix the issue by changing iRule. Line 2-3 do not work so I replace them with simple "if { [HTTP::uri] starts_with "/wpad.dat" then client can fetch wpad file and browse properly now. Thanks AMG and F5_rock for your willingness to assist me.
Recent Discussions
Related Content
* 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