Forum Discussion
Emilio_104473
Nimbostratus
Feb 14, 2009Redirect based on IP within X_FORWARDED_FOR
Hi,
I am looking to find the way to redirect requests made to a virtual server to be redirected to a another Pool, based on the IP address within X_forwarded_for header.
...
Emilio_104473
Nimbostratus
Feb 15, 2009That worked. I found another one which utilizes the data groups.
when HTTP_REQUEST {
if { [HTTP::header exists "X-Forwarded-For"] } {
set xff [HTTP::header "X-Forwarded-For"]
xff may be in format of addr1,addr2,addr3
set addrs [split $xff ","]
foreach addr $addrs {
if { [matchclass $::banned_addr_list equals $addr] } {
reject
}
}
}
}
Thank you,
Emilio
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