Forum Discussion
Gustavo_Lazarte
Nimbostratus
Sep 21, 2005Not sending traffic to first pool
Hello,
we just moved from 4.5 and this iRule is not sending any traffic to the edge-fx pool. I tested this iRule with other servers traffic and it is not sending any traffic to the first pool in this iRule,
Any ideas?
thanks
when HTTP_REQUEST {
if {[HTTP::uri] contains "www.website.com" or [HTTP::uri] contains "XX.XX.XX.XX"}{
if {[HTTP::uri] ends_with ".jpg" or [HTTP::uri] ends_with ".gif" or [HTTP::uri] ends_with ".JPG" or [HTTP::uri] ends_with ".GIF"}{
pool edge-fx
} else {
pool web_pool
}
}
}
- JRahm
Admin
Try using [HTTP::host] in the first if statement instead of [HTTP::uri] - Gustavo_Lazarte
Nimbostratus
Thanks - JRahm
Admin
yep. You can add some logging as well while getting used to iRules:when HTTP_REQUEST { log "HTTP host is [HTTP::host] and uri is [HTTP::uri]" if {[HTTP::host] contains "www.website.com" or {HTTP::host] contains "XX.XX.XX.XX"}{ if {[HTTP::uri] ends_with ".jpg" or [HTTP::uri] ends_with ".gif" or [HTTP::uri] ends_with ".JPG" or [HTTP::uri] ends_with ".GIF"}{ pool edge-fx } else { pool web_pool } } }
- Wow, I didn't know anyone had an EDGE-FX anymore! Sweet!
==== String Data Groups defined in the GUI ==== class hosts_to_cache { "www.website.com" "XX.XX.XX.XX" } class file_types_to_cache { ".gif" ".jpg" ".GIF" ".JPG" } ==== iRule ==== when HTTP_REQUEST { Note: I replaced "contains" with "equals" here since more than likely you want to do a full string compare on the host name. Change back to "contains" if you want to cover extensions of those host names if { [matchclass [HTTP::host] equals $::hosts_to_cache] } { if { [matchclass [HTTP::uri] ends_with $::file_types_to_cache] } { pool edge-fx } else { pool web-pool } } else { Just pointing out here that you left out the else clause of the first if. } }
- Gustavo_Lazarte
Nimbostratus
hello, - Gustavo_Lazarte
Nimbostratus
if i can figure out how to fail gif + jpg to my webpool i will change my IRule to something like - drteeth_127330Historic F5 AccountTry adding an LB_FAILED rule. If all members of pool edge-fx are down, then you will get an LB_FAILED event. You can then use web_pool. There are some examples in other posts to this forum. Don't worry about an LB_FAILED loop. The event will only be triggered once. Good luck!
- Gustavo_Lazarte
Nimbostratus
I been looking at my Admin guide and the forum for examples but it is not too clear to me where will the LB_FAILED will be used. Will it go inside the iRule or will it be a separate irule - Gustavo_Lazarte
Nimbostratus
I have this now, - drteeth_127330Historic F5 AccountI'm not sure I completely understand your question, but I would not expect the LB_FAILED clause to significantly impact the performance of the site.
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