Forum Discussion
iRule: Browser Error "The connection was reset"
Hello! I do appreciate your timely help with this issue I have.
I need to redirect all hits to specific URI to another pool keeping the same URI. Here is what I wrote that returns the above error:
when HTTP_REQUEST { if { [string tolower [HTTP::uri]] starts_with "/myuri" } { log local0. "redirect to New.pool" pool New.pool [HTTP::uri] } else { pool Old.pool } }
5 Replies
- Kevin_Stewart
Employee
You don't need to re-apply the URI.
when HTTP_REQUEST { if { [string tolower [HTTP::uri]] starts_with "/myuri" } { log local0. "redirect to New.pool" pool New.pool } else { pool Old.pool } }You're very likely getting that error because of a logic error in the iRule. You'll also want to enable OneConnect in your VIP and in the associated HTTP profile.
- Edgar_Palamarch
Nimbostratus
Thanks, Kevin! That's what I figured out. Looks like iRules are smart enough to preserve URI's and query strings. :-)
I don't have OneConnect enabled here. What would that change?
- cjunior
Nacreous
Hi, if you are intent to only select a pool, maybe it should be:
when HTTP_REQUEST { if { [string tolower [HTTP::uri]] starts_with "/myuri" } { log local0. "redirect to New.pool" pool New.pool } else { pool Old.pool } }statement uri in "pool New.pool [HTTP::uri]" is unnecessary here.
Hope it helps. - Edgar_Palamarch
Nimbostratus
Thanks, cjunior?
- Kevin_Stewart
Employee
I don't have OneConnect enabled here. What would that change?
What you're basically doing when you send traffic to different pools based on some request condition is something called "context switching". The problem is that load balancing decisions "stick" to the TCP session they're in. This becomes most apparent in a context switching environment when HTTP Keep-Alives are present. OneConnect allows you to load balance each request separately. Otherwise you may experience anomalous incorrect pooling.
Help guide the future of your DevCentral Community!
What tools do you use to collaborate? (1min - anonymous)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