Forum Discussion
yoni_100721
Nimbostratus
Jan 21, 2015iRule issue
We have this iRule:
Code
when HTTP_REQUEST {
[LB::server pool] returns the name of the default pool configured on the virtual server
set default_pool [LB::server pool]
dpt = default pool trimmed minus .trgc.com
set dpt [string trimright $default_pool .trgc.com]
g2a = go2agent appended name
set g2a "go2agent.trgc.com"
go2agent_pool = new full g2a pool name
set go2agent_pool "$dpt$g2a"
set uri [string tolower [HTTP::uri]]
if { $uri starts_with "/go2agent" } {
convert URI to not include go2agent
set nong2a_uri [substr [HTTP::uri] 9]
HTTP::uri $nong2a_uri
Log new URI and Pool info
log local0. $nong2a_uri
log local0. $go2agent_pool
pool $go2agent_pool
} else {
pool $default_pool
}
}I know its a mess but long story short if a user goes to http://website.com/go2agent it will send the users to a pool named websitego2agent.trgc.com instead of the default_pool. this works but every other request gets sent to websitego2agengo2agent.trgc.com so it adds go2agen for some reason that I cant figure out.
1 Reply
- yoni_100721
Nimbostratus
We were able to correct the behavior by using [HTTP::host] instead of [LB::server pool] to get the default pool value.
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