Forum Discussion
Stanislas_Piro2
Aug 30, 2018Cumulonimbus
you can use following code
when CLIENT_ACCEPTED {
set internal_network [class match [IP::client_addr] equals DG-INTERNAL-IP]
set insert_cookie 0
}
when HTTP_REQUEST {
if {$internal_network} {
pool TESTPOOL_443
} elseif {[URI::query [HTTP::uri] bypassMaintenance] equals "true"} {
HTTP::respond 302 Location [HTTP::path] "Set-Cookie" "bypassMaintenance=true;path=/"
} elseif {[URI::query [HTTP::uri] bypassMaintenance] equals "false"} {
HTTP::respond 302 Location [HTTP::path] "Set-Cookie" "bypassMaintenance=false;expires=Thu, 01-Jan-1970 00:00:01 GMT;path=/"
} elseif {[HTTP::cookie value bypassMaintenance] equals "true"} {
pool TESTPOOL_443
} else {
HTTP::redirect "http://maintenance.test.com"
}
}
the bypass uri is :
/?bypassMaintenance=true
or
/WhateverYouWant?bypassMaintenance=true