Thanks you for all your help, I'm getting there and had eveything working.
I'm now trying to impliment citizen_elah's suggestion of replacing all of the:
elseif { [TCP::client_port] == "8099" } {
pool node-10.128.32.2
}
with:
} elseif {
set match [lindex [findclass [TCP::local_port] $::server_ports] 1]
pool node-$match
}
Which I couldn't get to work so had a stab at it from scratch like this:
elseif { [lindex [matchclass [TCP::local_port] eq $::Individual_Servers] 1]} {
set match [lindex $::Individual_Servers 1]
node $match
}
I'm having a few problems though and as I keep getting the following error:
01070151:3: Rule [
www.vetsite.net] error: line 21: [undefined procedure: elseif] [elseif { [lindex [matchclass [TCP::local_port] eq $::Individual_Servers] 1]} {
set match [lindex $::Individual_Servers 1]
node $match
} ]
I'm now very confused, can anyone point out where I'm going wrong?
For reference my complete rule now looks like this:
when CLIENT_ACCEPTED {
TCP::collect 5
}
when CLIENT_DATA {
if { [matchclass [TCP::payload] starts_with $::http_methods] } {
SSL::disable
}
}
when HTTP_REQUEST {
if { [TCP::local_port] eq "80" } {
persist source_addr 1800
HTTP::fallback http://support.blackwellpublishing.com
pool wwwDEFAULT
}
elseif { [lindex [matchclass [TCP::local_port] eq $::Individual_Servers] 1]} {
set match [lindex $::Individual_Servers 1]
node $match
}
elseif { not [matchclass [TCP::local_port] eq $::Server_Ports] } {
HTTP::redirect "http://www.vetsite.net"
}
else {
discard
}
}
class http_methods {
"GET"
"POST"
"HEAD"
"PUT"
}
class ServerPorts {
"80"
"8099"
"8003"
"8004"
"8005"
"8006"
"8007"
"8008"
}
class Individual_Servers {
"8001 10.128.32.1"
"8099 10.128.32.2"
"8003 10.128.32.3"
"8004 10.128.32.4"
"8005 10.128.32.5"
"8006 10.128.32.6"
"8007 10.128.32.7"
"8008 10.128.32.8"
}