Forum Discussion
Only keep XFF header for specific subnet ranges
Hello
We have some external facing virtual servers that have requests coming in from both internal and external sources. What we'd like to do is keep XFF headers only for requests coming in from a set list of internal subnets and remove them for any requests from source IPs not defined in the list. How would we go about achieving this?
Thanks
AK
- SWJO
Cirrostratus
Hi
when HTTP_REQUEST {
if { [HTTP::header exists X-Forwarded-For] } {
if { [class match [HTTP::header X-Forwarded-For] equals my_external_ip] } {
HTTP::header remove X-Forwarded-For
}
}
else {
return
}
}
I didn`t test this rule. but this form would be work.
- SWJO
Cirrostratus
If it is easy to classify internal Ip, use this rule little switching.
Recent Discussions
Related Content
* 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