F5Hopper_28651
Aug 17, 2016Nimbostratus
passing or changing header data and passing to end server for identification.
I have a question, I made the below Irule... I was asked to update and send a new header to the end server for internal server redirection. Maybe not a header but something so they can see the traffic is from NJ or ID.. any ideas?
when HTTP_REQUEST {
if { ([string tolower [HTTP::uri]] starts_with "/testingpage") } {
Parse the client IP from the CDN header
set client_ip [HTTP::header "Incap-Client-IP"]
if { $client_ip eq "" }{
The header was empty/did not exist, so use the actual client IP
set client_ip [IP::client_addr]
}
switch [whereis $client_ip abbrev] {
"NJ" -
"ID" {
HTTP::respond 200 content "Your IP IS from NJ or ID"
}
default {
set state [whereis $client_ip abbrev]
HTTP::respond 200 content "Your IP IS NOT NJ or ID you is $state"
}
}
}
}
Im out of my element on this one.. Thanks Crew..