Forum Discussion
rsingh1988_3382
Altostratus
Nov 10, 2017conditional iRule for X-Forward-for
I have a requirement where client wants x-forward-for work in conditional manner. For example if client/user access abc.com then x-forward-for should not work but if client/user access abc.com/xyz, it should append client's ip.
Can we achieve this with irule? if yes can someone please help me with a code?
Thanks
1 Reply
- Lee_Sutcliffe
Nacreous
Hi, this iRule should do what you require
when HTTP_REQUEST { if {([HTTP::host] equals "abc.com") && ([HTTP::uri] starts_with "/xyz")} { HTTP::header insert X-Forwarded-For [IP::client_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