Poll with range of ports
Dear all,
I actually have a VS exposing some web services on https. The services are internally delivered from the same server on different ports, at the moment 11 ports from 8900 to 8910. The request is made like this: https://<my hostname>/<port>/<company>/<service uri>. To make it working I've created 11 different pool with same general suffix followed by the port number and wrote this iRule:
when HTTP_REQUEST {
if { [HTTP::host] equals "<my hostname>" } {
if { [HTTP::uri] matches_regex {/89[0-1][0-9]/} } {
set port [lindex [split [HTTP::uri] "/"] 1]
set company [lindex [split [HTTP::uri] "/"] 2]
set new_uri [string map -nocase [list $port/ ""] [HTTP::uri]]
switch -glob -- [URI::decode [HTTP::uri]] "
/$port/$company/* {HTTP::uri $new_uri
pool <common pool name>_$port}"
} else {
HTTP::respond 403 content {<html>Accesso Negato</html>}
}
}
}
Basically it checks if the hostname is correct and the request contains the range of port, then it takes the port number and company name rewrite the uri and choose the correct pool. Now the develompment team wants to extend the services from port 8900 to 8999. I'd like to avoid to create 100 different pools, is there a way to make this in a simpler manner?
Thank you in advance
Luca