Forum Discussion
ularssx_95224
Nimbostratus
Mar 10, 2009http redirect irule issue
Hello all -
I have what I thought should be a simple rule.
when HTTP_REQUEST {
if { [matchclass [HTTP::uri] contains $::siloSIRSI ] } {
pool syndetics2.com-linux
} elseif { [matchclass [HTTP::uri] contains $::clientURI ] } {
pool syndetics.com-linux
} elseif { [matchclass [HTTP::uri] contains $::badclient ] } {
pool Bad_Clients
} else {
pool Syndetics.com
}
}
All I am trying to do is pattern match against the inbound URI. I.E if it matches the first send to pool siloSIRSI, etc etc and the default pool is Syndetics.com - which is the pool the virtual server this rule is attached to is set to go to - I am not even sure if that final else is needed.
When I apply this rule it seems that requests that don't match the above rules go to limbo. Is there a better way to do this.
Thanks in advance if this is extremely obvious
Sean
- hoolio
Cirrostratus
Hi Sean,when HTTP_REQUEST { log local0. "[IP::client_addr]:[TCP::client_port]: New request to [HTTP::host][HTTP::uri]" if { [matchclass [HTTP::uri] contains $::siloSIRSI ] } { log local0. "[IP::client_addr]:[TCP::client_port]: Using pool syndetics2.com-linux" pool syndetics2.com-linux } elseif { [matchclass [HTTP::uri] contains $::clientURI ] } { log local0. "[IP::client_addr]:[TCP::client_port]: Using pool syndetics.com-linux" pool syndetics.com-linux } elseif { [matchclass [HTTP::uri] contains $::badclient ] } { log local0. "[IP::client_addr]:[TCP::client_port]: Using pool Bad_Clients" pool Bad_Clients } else { log local0. "[IP::client_addr]:[TCP::client_port]: Using pool Syndetics.com" pool Syndetics.com } }
- ularssx_95224
Nimbostratus
Hi - thanks for the quick response. I was able to quickly enable some logging this morning for a few minutes. Here is some output: - ularssx_95224
Nimbostratus
Not to reply to myself - but what appears to be breaking is traffic that doesn't match any of the data groups - i.e traffic that should be destined to the virtual server the rule is attached to - you get a connection interrupted at that point - but it immediately started would start working if I backed out the new rule. I must be missing something obvious - hoolio
Cirrostratus
If a client makes multiple requests over the same TCP connection, subsequent requests will not necessarily be sent to the default pool. It's always better to specify a default (or "else") clause in the iRule if you're selecting a pool. You can do this without hardcoding the name of the default pool:when CLIENT_ACCEPTED { Save the name of the VIP's default pool set default_pool [LB::server pool] } when HTTP_REQUEST { if {$some_condition==1}{ pool pool_1 } elseif {$some_other_condition==1}{ pool pool_2 } else { Use the VIP's default pool pool $default_pool } }
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