Forum Discussion
Robert_47833
Altostratus
Jul 04, 2011need help in forward uri to different pool via specific percentage
I have two pool: cjj1 ,cjj2
1:for uri in data group aaa, send 80% request to cjj1 and 20% to cjj2
2:if one client visit cjj1,all other requests from this client should be sent to cjj1,s...
Robert_47833
Altostratus
Jul 06, 2011hI,I have worked out,but still need to confirm with u in some details
Can u have a look at the irule below
when HTTP_RESPONSE {
if { $stubhubA_cookie == 1 }{
HTTP::cookie insert name stubcjjA_cookie value 1 path "/"
HTTP::cookie expires "stubcjjA_cookie" "25920000" relative
}
if { $stubhubB_cookie == 1 }{
HTTP::cookie insert name stubhubB_cookie value 1 path "/"
HTTP::cookie expires "stubhubB_cookie" "25920000" relative
}
}
when HTTP_REQUEST {
set stubcjjA_cookie 0
set stubcjjB_cookie 0
if {[class match $uri starts_with gen3abURLs_SRWD29]} {
if {[HTTP::cookie value stubcjjA_cookie] == 1}{
pool SRWD29-G3-BRX
log local0. "BRX $stubcjjA_cookie PERSIST"
return
}
if {[HTTP::cookie value stubcjjB_cookie] == 1}{
pool SRWD29-BROWSE
log local0. "BRX $stubcjjB_cookie PERSIST"
return
}
if { rand() <0.2 } {
pool SRWD29-G3-BRX
set stubhubA_cookie 1
log local0. "BRX stubhubA_cookie $stubcjj_cookie "
} else {
pool SRWD29-BROWSE
set stubhubB_cookie 1
log local0. "BRS stubhubB_cookie $stubcjjB_cookie "
return
}
}
questiones:
1:when u mention session cookie ,it means when I close the broswer,the cookie will expire?
how to set cookie as session cookie or permanent cookie
2:in the HTTP_RESPONSE event,it will affect all the http response? if some traffic didn't have the cookie,what will irule do?
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