Forum Discussion
rule sending to wrong pool if connection is already established
Here is my irule
when HTTP_REQUEST {
log local0. "Requested HTTP Method: [HTTP::method]"
if { [HTTP::path] starts_with "/root/landingpages/affLandPage.asp" or
[HTTP::path] starts_with "/root/offer.asp" or
[HTTP::path] starts_with "/root/campaign.asp" or
[HTTP::path] starts_with "/root/basket.asp" or
[HTTP::path] starts_with "/root/redirects/add2cart.asp"} {
log local0. "Requested uri is [HTTP::uri]"
prefix legacy stuff to the original URI and add the requested host
HTTP::uri /legacyeol?legacyUrl=http://[HTTP::host][HTTP::uri]
replace the requested host
HTTP::header replace Host "home.foo.com"
log local0. "Redirected hostheader is [HTTP::header value Host]"
forward the modified request to home pool
pool home-qw-5
log local0. "Forwarding to pool [LB::server]"
log local0. "Redirected HTTP Method: [HTTP::method]"
}
}
When I hit the VIP with this irule applied with this uri
http://us.foo.com/root/offer.asp?id=4934&affid=315
it will forward it to the home-qw-5 pool fine. Excellent.
Then while the connection has not timed out and go to
http://us.foo.com/root/popup.asp?path=/common/en-us/popups/mpfp/moreInfo.asp&close=true
which does not match the if statement I will get a 404. In the server logs I see that it's because the LTM is still forwarding it to the home-qw-5 pool which isn't hosting us.foo.com.
If I kill the connection with b conn client delete or wait a few minutes for it to timeout and try the uri again I do not get the 404 because it directs it to the default pool of the VIP.
It seems that the rule is setting the pool as the default pool for the session. How do I properly write this and is my understanding of what it's doing accurate?
- goyogiNimbostratusI think this post answers my question
- hooleylistCirrostratusOr just add a OneConnect profile to the virtual server. If you're using SNAT on the serverside, you can use the default OneConnect profile with a /0 source mask. If you're not doing source address translation on the serverside connection then create a custom OneConnect profile with a /32 source mask.
- goyogiNimbostratusThanks Aaron. I verified that works. We already are using oneconnect in production but not QA where we discovered this. I also like the idea of an explicit else statement and will play with the best way to approach it.
Recent Discussions
Related Content
* 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