Forum Discussion
Steve_Brown_882
Sep 12, 2007Historic F5 Account
Help with Persit Irule
Hello All,
I have been working on rule that uses a unique x-forwarded-for header to persit traffic.
My orginal rule (below) works fine however when a customer hits the VIP that does not have the "X-Netli-Forwarded-For" header the traffic fails.
when HTTP_REQUEST {
set xff_addr [HTTP::header "X-Netli-Forwarded-For"]
persist uie $xff_addr
}
So I created this irule (below) instead of the first one, however this seem to cause me to recieve 500 errors from my app server so I think it is breaking the request some how.
when HTTP_REQUEST {
if { [HTTP::header exists "X-Netli-Forwarded-For"] } {
set persit_addr [HTTP::header "X-Netli-Forwarded-For"]
} else {set persit_addr [IP::client_addr]}
persist uie $persist_addr
}
Any Thoughts on this?
- hoolio
Cirrostratus
There is a typo in your rule with "persit". You should actually see a TCL error in /var/log/ltm stating the $persist_addr variable doesn't exist.when HTTP_REQUEST { if { [HTTP::header exists "X-Netli-Forwarded-For"] } { set persist_addr [HTTP::header "X-Netli-Forwarded-For"] } else { set persist_addr [IP::client_addr] } persist uie $persist_addr 600 }
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