Forum Discussion
ICAP with iRule Response Page without ASM
Try this:
when ADAPT_REQUEST_RESULT {
log local0. "ADAPT_REQUEST_RESULT: [ADAPT::result]"
if { ([ADAPT::result] contains "respond") } {
log local0. "ICAP Response is [ADAPT::result], let's customized reject page"
set response {
<html>
<head>
<title>Virus Detected</title>
<meta http-equiv="refresh" content="0;URL='https://int-www-01.citizensfla.com/virus-test'" />
</head>
</html>
}
HTTP::respond 200 content $response
}
}
Thanks Niels for your response. I tried this Irule but got the Connection timeout error. I created below Irule and it's working as expected-
when HTTP_REQUEST {
set VirusDetected 0
log local0. "AOB-TEST iRule initiated and VirusDetected variable to 0"
}
when ADAPT_REQUEST_RESULT {
if { ([ADAPT::result request] contains "respond") } {
set VirusDetected 1
log local0. "ICAP: Check ADAPT VAR: == $VirusDetected => Virus Found"
}
else {
set ADAPTvar 0
log local0. "ICAP: Check ADAPT VAR: == $VirusDetected=> Virus NOT Found"
}
}
when HTTP_RESPONSE_RELEASE {
if { $VirusDetected == 1 } {
HTTP::respond 301 Location "https://xxxxx.xxxx.com/virustest"
log local0. "redirected to corporate network after Virus was Dectected"
}
}
- Wasfi_BounniJun 19, 2023Cirrocumulus
Of course this i-rule is on the https virtual server not the internal ICAP virtual server, right?
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