Irule not working to insert header value when we issue URI redirect in different irule as below.
Rule 1:-irule.x-forwarded-for.fix when HTTP_REQUEST { if {[HTTP::header exists True-Client-IP] } { HTTP::header insert WL-Proxy-Client-IP [HTTP::header value True-Client-IP] } else { HTTP::header insert WL-Proxy-Client-IP [IP::client_addr] }
Rule2:- irule.site.maintenance:- when HTTP_REQUEST {
Set value to 1 if auto mobile maintenance required. Set value to 0 If there is no auto mobile maintenance required. Default Value is 0.
set mobile_maintenance_prod 1
if { $mobile_maintenance_prod==1 } { switch -glob [string tolower [HTTP::path]] { “/abc/*” { set json "{ “Maintainance Message” } HTTP::respond 200 content $json “Content-Type” “application/json”; event disable; unset json; }
/Uri1* /Uri2* /ur3* { HTTP::redirect “/auto/site-unavailable/index.html”; event disable; } } } }
Note:-Please dont blame for bracing issues.