Gregt_33960
May 22, 2008Nimbostratus
IRULES to append and Web Server Errors
Hello,
I have found this forum extremely helpful as I learn more about IRules. I have multiple application environments running on pools of webservers. I have to set the F5 to perform URI Filtering, which I have successfully done to a certain point. In addition, because of the way the developers deploy the XML, that when a user types in the URL::URI the first time to login I have to append a string on the end of the request to get to the login page. That to is successful to a point.
I have two issues that I need resolving and my IRules are not working and not sure how to proceed. Any insight would be wonderful. My IRule is listed below.
ISSUE 1
When a user types the URL::URI with a trailing "/" I get standard error "Page not found" from my browser... Example below
http://test.domain.com/train --> this works fine and get to login Page
http://test.domain.com/train/ --> This fails with Page Not found in browser
I tried adding an "or" statement in my elseif statments but it did not work and actually broke the other pages.
ISSUE 2
I have assigned a default pool (user_pool) to the Virtual Server, but I am trying to find the logic similar to the other environments, where a user types:
http://test.domain.com
and the F5 appends and the becomes
http://test.domain.com/user/jsp/common/pgLogin.jsp
I am not seeing how to do that.
Any help would be grateful
Thanks
Greg
************* BEGIN IRULE **********************
URI Load Balancing
Desired URI to pool mapping
http://test.domain.com --> user_pool
http://test.domain.com/train --> train_pool
http://test.domain.com/pilot --> pilot_pool
http://test.domain.com/whatif --> whatif_pool
http://test.domain.com/sandbox --> sandbox_pool
when HTTP_REQUEST {
log local0. "Current URI: [HTTP::uri]"
if {[HTTP::uri] starts_with "/sandbox" }{
if {[HTTP::uri] ends_with "/sandbox" } {
HTTP::uri "/sandbox/jsp/common/pgLogin.jsp"
}
pool sandbox_pool
} elseif {[HTTP::uri] starts_with "/pilot"}{
if {[HTTP::uri] ends_with "/pilot" }{
HTTP::uri "/pilot/jsp/common/pgLogin.jsp"
}
pool pilot_pool
} elseif {[HTTP::uri] starts_with "/whatif"}{
if {[HTTP::uri] ends_with "/whatif" }{
HTTP::uri "/whatif/jsp/common/pgLogin.jsp"
}
pool whatif_pool
} elseif {[HTTP::uri] starts_with "/train"}{
if {[HTTP::uri] ends_with "/train" }{
HTTP::uri "/train/jsp/common/pgLogin.jsp"
}
pool train_pool
}
}
************** END IRULE ******************