Forum Discussion
Gregt_33960
Nimbostratus
Jun 11, 2008IRule send to wrong Pool and Port
Hello,
I am hoping this is going to be an easy fix. I have several web server instances over various ports on a web server and the IRule, using URI filters, was working fine, until I needed to add one more.
I have the following pools & ports defined
train_pool port 9080
uat_pool port 7080
test_pool port 9081
uatpr_pool port 5080
Now my base URL for the filter is http://test.domain.com
and when the URI is appended at the end, the F5 Filters and sends to the proper pool and Port. For example
http://test.domain.com/uat --> the F5 sends to uat_pool on port 7080 ( this works fine)
Now when I try to do:
http://test.domain.com/uatpr I am now getting this error message:
A WebGroup/Virtual Host to handle test.domain.com:7080 has not been defined.
I have no idea why it is trying to send to port 7080? That is not the pool or port I defined for that instance. Does the f5 do some sort of pattern matching and gets confused if there are two URIs that are similar?
Does anyone have any insights please.
thanks
Greg
- The_Bhattman
Nimbostratus
Hi Greg, - Gregt_33960
Nimbostratus
Absolutely... Please note that I did a Copy and paste and when I post I may lose the TAB formating.when HTTP_REQUEST { log local0. "[IP::client_addr]:[TCP::client_port]:[HTTP::uri]" if {[HTTP::uri] starts_with "/train" }{ if {([HTTP::uri] ends_with "/train") or ([HTTP::uri] ends_with "/train/")} { HTTP::uri "/train/jsp/common/pgLogin.jsp" } pool train_pool } elseif {[HTTP::uri] starts_with "/uat"}{ if {([HTTP::uri] ends_with "/uat") or ([HTTP::uri] ends_with "/uat/")}{ HTTP::uri "/uat/jsp/common/pgLogin.jsp" } pool uat_pool } elseif {[HTTP::uri] starts_with "/uatpr"}{ if {([HTTP::uri] ends_with "/uatpr") or ([HTTP::uri] ends_with "/uatpr/")}{ HTTP::uri "/uatpr/jsp/common/pgLogin.jsp" } pool uatpr_pool } elseif {[HTTP::uri] starts_with "/" }{ if {[HTTP::uri] ends_with "/"}{ HTTP::uri "/uat/jsp/common/pgLogin.jsp" } pool uat_pool } }
- Andy_Herrman_22
Nimbostratus
You need to rearrange your If statements. - The_Bhattman
Nimbostratus
HI Greg,when HTTP_REQUEST { switch -glob [HTTP::uri] { "/train*" { pool train_pool } "*/train" { HTTP::uri "/train/jsp/common/pgLogin.jsp" } "/uatpr*" {pool uatpr_pool} "*/uatpr" { HTTP::uri "/uatpr/jsp/common/pgLogin.jsp" } "/uat*" {pool uat_pool} "*/uat" { HTTP::uri "/uat/jsp/common/pgLogin.jsp" } default { pool uat_pool} } }
- Gregt_33960
Nimbostratus
- Deb_Allen_18Historic F5 AccountGood call on the switch case, CB. Doesn't look like you are making the pool selection in the case of the URI re-writing, is all - the switch is a case statement, and will drop out after executing the first match body.
when HTTP_REQUEST { first set the pool for any URI containing one of the subdirs switch -glob [HTTP::uri] { "*/train*" { pool train_pool } "*/uatpr*" { pool uatpr_pool } "*/uat*" { pool uat_pool } } now re-write the URI's when necessary a "-" means to execute the same body as the next condition The only diff betw the 2 strings is whether the leading '/" is needed switch -glob [HTTP::uri] { "*/train/" - "*/uatpr/" - "*/uat/" { HTTP::uri "[HTTP::uri]jsp/common/pgLogin.jsp" } "*/uatpr" - "*/train" - "*/uat" { HTTP::uri "[HTTP::uri]/jsp/common/pgLogin.jsp" } } }
- Gregt_33960
Nimbostratus
Wow... that looks pretty slick... I am going to test this in about an hour. One last question if Might. - Gregt_33960
Nimbostratus
Did not work as planned - The_Bhattman
Nimbostratus
Did you try using "default { pool state_uat_pool }" instead of "*/*" { pool state_uat_pool }? - Gregt_33960
Nimbostratus
CB,
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