Forum Discussion
danielng_19608
Nimbostratus
Apr 28, 2009Customizing X-Forwarded-For certain websites
Hi all,
currently my setup is to enable X-Forwarded for all traffic that is hitting the Internet.
What i would like to do is to NOT enable X-Forwarded when accessing cer...
danielng_19608
Nimbostratus
May 04, 2009Hi Aaron,
this is what i came out with. Basically, i am trying to match another condition that is any string which contains what i have specified in the datagroup selectedSites will be checked. I tried to specify selectedSites as a String datagroup but it doesnt seem to be working. Any advise on this?
=================================================================================
if {[matchclass [IP::client_addr] equals $::trustedAddresses]}
{
set insertxff 0
}
else
{
set insertxff 1
}
}
when HTTP_REQUEST {
if { $insertxff equals 0 and ([string tolower [HTTP::host]] contains $::selectedSites)}
{
Remove existing XFF headers if both conditions match
HTTP::header remove X-Forwarded-For
}
else
{
Insert new XFF header
HTTP::header insert X-Forwarded-For [IP::remote_addr]
}
}
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
