Forum Discussion
F5Hopper_28651
Nimbostratus
Aug 17, 2016passing 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 traf...
ekaleido
Cirrus
Aug 17, 2016Perhaps something like this to replace your HTTP::response 200s?
switch [whereis $client_ip abbrev] {
"NJ" { HTTP::header insert User-Loc "NJ" }
"ID" { HTTP::header insert User-Lov "ID" }
}
F5Hopper_28651
Nimbostratus
Aug 17, 2016that looks good, I will give that a try.
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" {
HTTP::header insert User-Loc "NJ"
}
"ID" {
HTTP::header insert User-Loc "ID"
}
"CA" {
HTTP::header insert User-Loc "CA"
}
}
}
}
Help guide the future of your DevCentral Community!
What tools do you use to collaborate? (1min - anonymous)Recent Discussions
Related Content
DevCentral Quicklinks
* 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
Discover DevCentral Connects