Forum Discussion
Tom_Lauwereins_
Nimbostratus
Feb 10, 2012peristence based on HTTP header field
Hi,
I'm looking for a way to persist http requests based on the http header field.
How to do this via an iRule or is there a more easy way to handle the traffic always to the same pool ...
nitass
Employee
Feb 10, 2012in case http header value is coming from client side and always shown in all request.
e.g.
[root@ve1023:Active] config b virtual bar list
virtual bar {
snat automap
pool foo
destination 172.28.19.79:80
ip protocol 6
rules myrule
profiles {
http {}
tcp {}
}
}
[root@ve1023:Active] config b pool foo list
pool foo {
members {
200.200.200.101:80 {}
200.200.200.102:80 {}
}
}
[root@ve1023:Active] config b rule myrule list
rule myrule {
when HTTP_REQUEST {
if {[HTTP::header exists "Look-at-Me"]} {
persist uie [HTTP::header "Look-at-Me"]
}
}
}
[root@ve1023:Active] config b persist show all
No Persistence Table Entries were found.
[root@ve1023:Active] config curl -I http://172.28.19.79 -H "Look-at-Me: helloworld"
HTTP/1.1 200 OK
Date: Sat, 11 Feb 2012 00:19:14 GMT
Server: Apache/2.2.3 (CentOS)
Last-Modified: Fri, 11 Nov 2011 14:48:14 GMT
ETag: "4183e4-3e-9c564780"
Accept-Ranges: bytes
Content-Length: 62
Content-Type: text/html; charset=UTF-8
[root@ve1023:Active] config b persist show all
PERSISTENT CONNECTIONS
| Mode universal Value helloworld
| virtual 172.28.19.79:80 node 200.200.200.101:80 age 2sec
[root@ve1023:Active] config curl -I http://172.28.19.79 -H "Look-at-Me: 12345"
HTTP/1.1 200 OK
Date: Sat, 11 Feb 2012 00:15:00 GMT
Server: Apache/2.2.3 (CentOS)
Last-Modified: Tue, 08 Nov 2011 12:26:29 GMT
ETag: "4183f1-30-47e02740"
Accept-Ranges: bytes
Content-Length: 48
Content-Type: text/html; charset=UTF-8
[root@ve1023:Active] config b persist show all
PERSISTENT CONNECTIONS
| Mode universal Value helloworld
| virtual 172.28.19.79:80 node 200.200.200.101:80 age 23sec
| Mode universal Value 12345
| virtual 172.28.19.79:80 node 200.200.200.102:80 age 3sec
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