Forum Discussion
rich1977_120837
Nimbostratus
Aug 27, 2015IRULE to remove a header value
so I've enabled the xforward in the http profile, set the below irule on the vip:
when HTTP_REQUEST {
HTTP::header insert X-MS-Forwarded-Client-IP [IP::remote_addr]
}
This inserts the origi...
arpydays
Nimbostratus
Aug 28, 2015Use replace instead of insert, which will just add another header. Try putting in the following log statements before after the header replace to see what headers are coming in and what are being sent out.
when HTTP_REQUEST {
foreach x [HTTP::header names] {
if { $x equals "X-MS-Forwarded-Client-IP" } {
log local0. "Incoming $x: [HTTP::header $x]"
}
}
HTTP::header replace X-MS-Forwarded-Client-IP [IP::remote_addr]
foreach x [HTTP::header names] {
if { $x equals "X-MS-Forwarded-Client-IP" } {
log local0. "Outgoing $x: [HTTP::header $x]"
}
}
}
you should see something like this in the logs, e.g. a request from 10.12.12.1 client-ip but with a X-MS.. header of 11.11.11.11, the F5 is replacing the header with 10.12.12.1 as per rule ...
curl -vv -H "X-MS-Forwarded-Client-IP: 11.11.11.11" http://10.10.10.10
Rule /Common/test1 : Incoming X-MS-Forwarded-Client-IP: 11.11.11.11
Rule /Common/test1 : Outgoing X-MS-Forwarded-Client-IP: 10.12.12.1
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