Forum Discussion
SteveT_240596
Nimbostratus
Feb 03, 2016session persistance using x-forward-for
The traffic coming to our virtual server is being reverse proxied from 2 TMG servers meaning we only see 2 source IP addresses. The header does contain the x-forward-for address of the original clien...
Kai_Wilke
MVP
Feb 03, 2016Hi Steve,
you may try the snippet below...
when HTTP_REQUEST {
if { [HTTP::header value "X-Forwarded-For"] ne "" } then {
log local0. "PATTS \"X-Forwarded-For\" header: [HTTP::header value "X-Forwarded-For"]"
persist uie [HTTP::header value "X-Forwarded-For"] 1830
} else {
log local0. "No \"X-Forwarded-For\" header found."
}
}
Note: I duno if you posted just the half iRule for illustration purposes? I've completed then given iRule, tweaked here and there a little bit the syntax and added an additional [log] statement to get some ouput if no X-Forwarded-For header is not present or somehow empty.
Cheers, Kai
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