VS with Wildcard Pool set path to specific port
Good Day -
Today we have a Virtual Server listening on port 443, and an irule with 300+ lines to switch pool based on the path. Example of current irule is below:
when HTTP_REQUEST {
switch -glob [string tolower [HTTP::path]] {
"/site1/score/sap/wbse/search" { pool pool_site1.test.com_34561 }
"/site1/score/sap/companycodes" { pool pool_site1.test.com_34561 }
"/site2/score/timekeeper/unionmasterdata/contract" { pool pool_site2.test.com_34562 }
"/site2/score/timekeeper/unionmasterdata/jobcode" { pool pool_site2.test.com_34562 }
"/site3/score/sap/chartofaccounts/glaccount*" { pool pool_site3.test.com_34563 }
"/site3/score/timekeeper/timecard/gettimecard" { pool pool_site3.test.com_34563 }
default {
pool pool_site0.test.com_33333
}
}
}
So the above irule goes on for over 300+ more lines.
Here is the problem with this:
Above setup we are creating over 200+ individual pools of servers with the same 5 servers but just on different ports.
Original reason for all the pools is not every port would be up all the time so in the beginning it was simple just to create a pool, but now this is getting un-managable.
What I would like to do is the following:
Since all the servers in the over 200+ pools are exactly the same but only on a different port I would like to create a wildcard pool instead with just the 5 servers in them.
pool pool_site0.test.com
member server0.test.com:0
member server1.test.com:0
member server2.test.com:0
member server3.test.com:0
member server4.test.com:0
Move the path / destination port into a Data group and create an iRule that will match the path then check if the server in the wildcard pool responds to the port and if so then send the request to that server.
So requesting assistance on creating an irule that:
- Read the path on the incoming request
- Match path in datagroup and map destination port based on path matched in datagroup
- Check if the servers in the wildcard server pool responds on the port matched
- if port responds on server, then send request to server that responds.
Any assistance would be appreciated.
Thx
Rich