Forum Discussion
Ian_Stewart_390
Nimbostratus
Apr 20, 2005iRules Pool Selection
Hi. 😃
We have an F5 BigIP-1500, running 9.04, configured with 4 virtual servers. (80/443 on IP1, 80/443 on IP2). Persistance is by cookie insertion, and is enabled across services. We have OneConnect enabled, and do compression based on browser and resource type.
We're in the process of moving from an older website infrastructure to a new one, so we have a URL based routing rule that moves people on to the new server when they access certain URLs. The rule is as follows:
when HTTP_REQUEST {
set my_uri [string tolower [HTTP::uri]]
set my_host [string tolower [HTTP::host]]
if { $my_uri contains "/iRuleURI/" } {
pool webnode_pool
log local0. "Directing to Webnode pool: $my_host $my_uri "
}
if { $my_uri contains "aspnet_client" } {
pool webnode_pool
log local0. "Directing to Webnode pool: $my_host $my_uri "
}
}
www.mywebsite1.com (HTTP/HTTPS) uses ecommerce_pool
www.mywebsite2.com (HTTP/HTTPS) uses webnode3_pool
-----------------------------------------------
I'm on www.mywebsite1.com/goodtimes.aspx
Button 1 makes a HTTP post to
www.mywebsite1.com/iRuleURI/otherpage.aspx.
Button 2 makes a HTTP POST to
www.mywebsite2.com/uri1/page.aspx
Clicking button 1 should route traffic to webnode_pool. (iRule)
Clicking button 2 should route traffic to webnode3_pool.
If, on hitting the page for the first time, I click button 1, it works correctly. Or, if I click button 2 it works correctly. However. If I click button 1, and close the popup-page, and then click button 2, it incorrectly posts my data to webnode_pool. This results in a 404 Page Not Found. Then, if I hit refresh, it correctly posts to webnode3_pool, and it works.
I have packet logs to show I'm not crazy, and this really is happening. In the described situation, the F5 creates a new TCP connection to the wrong pool, and makes a post that fails. Then I hit refresh, and it creates a new TCP connection to the RIGHT pool, and the post goes though.
Any ideas on why this might be happening? I called support, because this seemed like it might be a bug (having read your post), but they asked me to post here.
-Ian
6 Replies
- unRuleY_95363Historic F5 AccountWell, the only thing obvious to me is that you saved your uri in lowercase, but then are comparing it to a string containing both upper and lowercase characters. Doesn't seem like that would ever match...
- Ian_Stewart_390
Nimbostratus
That's my own fault. =) The actual iRule is written correctly in that sense -- I changed the capitialization to camel case in order to try and make my post more readable. =) - unRuleY_95363Historic F5 AccountThe other thing I noticed is that your if's are not chained. Eg, it's not "if { expr } { body } elseif { expr } { body }"
- Ian_Stewart_390
Nimbostratus
Hi unRuleY, - unRuleY_95363Historic F5 AccountYou may also want to look at this post: Click here
- Ian_Stewart_390
Nimbostratus
That was exactly it. I stole the "when CLIENT_ACCEPTED" and the final else from that other post, and it works great now.
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