Forum Discussion
bruno_thomas_12
Nimbostratus
Jul 25, 2005Basic HTTP redirect question on LB pool
when HTTP_REQUEST
if HTTP:URL contains '/acces'
pool bea_pool
It seems like all subsequent requests are redirected to home page of the web servers, Http host/acces. Is there a way to keep the contextual URI for the subsequent pages
would this work:
pool bea_pool$uri ????????
thx
10 Replies
- bruno_thomas_12
Nimbostratus
this is the actual code :
when HTTP_REQUEST {
set uri [HTTP::uri]
if { $uri contains "acces" } {
pool bea_pool$uri
} elseif { $uri contains "aide" } {
HTTP::redirect "http://10.172.155.201/$uri"
}
} - unRuleY_95363Historic F5 AccountWell, there is nothing that would otherwise prevent that from working. However, I'm not entirely sure that it accomplishes what you want. I think you may be better off using a Cookie to save the context across requests. For example:
when CLIENT_ACCEPTED { set add_cookie "" } when HTTP_REQUEST { if { [HTTP::cookie exists "MyCookie"] } { MyCookie contains the original pool used pool bea_pool } else { This must be the first access if { [HTTP::uri] contains "acces" } { pool bea_pool set add_cookie bea_pool } elseif { [HTTP::uri] contains "aide" } { HTTP::redirect "http://10.172.155.201/[HTTP::uri]" } else { What should happen here? Is there a default pool on the VS that will be used if none is specified here? } } } when HTTP_RESPONSE { if { $add_cookie ne "" } { HTTP::cookie insert name "MyCookie" value $add_cookie set add_cookie "" } } - bruno_thomas_12
Nimbostratus
01070151:3: Rule [persistence] error:
line 13: [deprecated usage, use else or elseif] [ ]
line 13: [missing an expression] [ ]
line 10: [undefined procedure: [HTTP::uri] contains "aide" ] [if { [HTTP::uri] contains "acces" } {
pool bea_pool
set add_cookie bea_pool
} else if { [HTTP::uri] contains "aide" } {
HTTP::redirect "http://10.172.155.201/[HTTP::uri]"
} else {
What should happen here?
this what i get.. i did not dig yet but maybe you can help me. - bruno_thomas_12
Nimbostratus
elseif instead of else if seems to have fix it..thanks - bruno_thomas_12
Nimbostratus
once i associate rule (persistence) to virtual server i get this:
01070394:3: HTTP_REQUEST event in rule (persistence) requires an associated HTTP or FASTHTTP profile on the virtual server (Redir_https). - bruno_thomas_12
Nimbostratus
i associated with default http profile..big ip is taking the config but it s still not working ....at some point traffic seems to fall on other node and auth page is represented.. - bruno_thomas_12
Nimbostratus
it seems like something ends the session without it being over... - unRuleY_95363Historic F5 AccountDoes this happen without the rule on the virtual?
- bruno_thomas_12
Nimbostratus
we where succesfull applying persistence without using irule?? question what s the difference between using weblogiccookie or just plain cookie? - unRuleY_95363Historic F5 AccountThat's a really good question! -> Perhaps to save one less cookie???
I'll have to think about this, as I don't have a good answer right now...
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