Forum Discussion
navgup_66025
Nimbostratus
Aug 08, 2013Auth_Status and Persist
1) I have PoolK and PoolF and default pool has to be PoolK
2) first client request always go to PoolK
3) Check if client has been authenticated to PoolK using Auth_status command, if YES pe...
nitass
Employee
Aug 10, 2013At this point, i want the next or any future HTTP_REQUEST to persist on poolK from this client (because i am already authorized), but instead it is falling back to default PoolF and breaking my page because /nad is not in the uri? in HTTP_REQUEST, may we check if bigip cookie exists? if yes, we just direct request to PoolK. anyway, since you modify response using HTTP::respond, you may have to include bigip cookie in the response.
e.g.
[root@ve10:Active] config b virtual bar list
virtual bar {
snat automap
pool PoolF
destination 172.28.19.252:80
ip protocol 6
rules myrule
persist cookie
profiles {
http {}
tcp {}
}
}
[root@ve10:Active] config b pool PoolF list
pool PoolF {
members 200.200.200.101:80 {}
}
[root@ve10:Active] config b pool PoolK list
pool PoolK {
members {
200.200.200.101:80 {}
200.200.200.111:80 {}
}
}
[root@ve10:Active] config b rule myrule list
rule myrule {
when HTTP_REQUEST {
set host [HTTP::host]
set uri [HTTP::uri]
set ckkval [HTTP::cookie value BIGipServerPoolK]
set ckfval [HTTP::cookie value BIGipServerPoolF]
if { $uri contains "/nad" or [HTTP::cookie exists BIGipServerPoolK] } {
pool PoolK
}
}
when HTTP_RESPONSE {
log local0. "host: $host uri: $uri cookie: BIGipServerPoolK=$ckkval BIGipServerPoolF=$ckfval pool: [LB::server pool] node: [LB::server addr] status: [HTTP::status]"
if { [HTTP::status] == 404 and [LB::server pool] equals "PoolK" } {
HTTP::respond 302 noserver Location "http://$host" "Set-Cookie" "BIGipServer[LB::server pool]=[HTTP::cookie BIGipServer[LB::server pool]]; path=/"
}
}
}
test
[root@ve10:Active] config tail -f /var/log/ltm
----- browse http://172.28.19.252/ -----
Aug 10 11:06:39 local/tmm info tmm[4873]: Rule myrule : host: 172.28.19.252 uri: / cookie: BIGipServerPoolK= BIGipServerPoolF= pool: PoolF node: 200.200.200.101 status: 200
Aug 10 11:06:39 local/tmm info tmm[4873]: Rule myrule : host: 172.28.19.252 uri: /f5.gif cookie: BIGipServerPoolK= BIGipServerPoolF=1707657416.20480.0000 pool: PoolF node: 200.200.200.101 status: 200
Aug 10 11:06:39 local/tmm info tmm[4873]: Rule myrule : host: 172.28.19.252 uri: /favicon.ico cookie: BIGipServerPoolK= BIGipServerPoolF=1707657416.20480.0000 pool: PoolF node: 200.200.200.101 status: 404
----- browse http://172.28.19.252/nad -----
Aug 10 11:07:08 local/tmm info tmm[4873]: Rule myrule : host: 172.28.19.252 uri: /nad cookie: BIGipServerPoolK= BIGipServerPoolF= pool: PoolK node: 200.200.200.101 status: 404
Aug 10 11:07:08 local/tmm info tmm[4873]: Rule myrule : host: 172.28.19.252 uri: / cookie: BIGipServerPoolK=1707657416.20480.0000 BIGipServerPoolF= pool: PoolK node: 200.200.200.101 status: 200
Aug 10 11:07:08 local/tmm info tmm[4873]: Rule myrule : host: 172.28.19.252 uri: /f5.gif cookie: BIGipServerPoolK=1707657416.20480.0000 BIGipServerPoolF= pool: PoolK node: 200.200.200.101 status: 200
Aug 10 11:07:08 local/tmm info tmm[4873]: Rule myrule : host: 172.28.19.252 uri: /favicon.ico cookie: BIGipServerPoolK=1707657416.20480.0000 BIGipServerPoolF= pool: PoolK node: 200.200.200.101 status: 404
Aug 10 11:07:08 local/tmm info tmm[4873]: Rule myrule : host: 172.28.19.252 uri: / cookie: BIGipServerPoolK= BIGipServerPoolF= pool: PoolK node: 200.200.200.101 status: 304
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