Forum Discussion
Pav_70755
Feb 20, 2012Nimbostratus
Accessing individual servers / nodes via a different port
I came accross a complete Irule which I used a few years ago which had this section in it:
when HTTP_REQUEST {
set srvr [findclass [TCP::local_port] $::TST_Individual_Servers " "]
if { $srvr ne "" } {
node $srvr 80
}
}
Where TST_Individual_Servers is a datagroup containing a list of node IP addresses and corresponding ports in this case:
server1:= 10.0169.128.21%3:8001
server2:= 10.0169.128.22%3:8002
So with a virtual server listening @ www.testdomain.com with 2 node members in a pool (Which are the nodes in the datagroup string)
I want to be able to go to www.testdomain.com:8001 and go to that specific node and www.testdomain.com:8002 and go to server 2
would this also work with remote desktop access directly to the server?
as we are able to do this atm but need to have seperate virtual servers and pools for each node so pools with single node members in order to do this and in our production environments this means creating a lot of extra pools for sites that have say 10 memebers.
Thanks any help much apprecaited.
Pav
- hooleylistCirrostratusHi Pav,
- Pav_70755NimbostratusHi Hoolio,
- Pav_70755Nimbostratus
when HTTP_REQUEST { if { [TCP::local_port] eq "80" } { persist cookie insert Test_Pool pool TST_www.test.com-80 } else { set srvr [findclass [TCP::local_port] $::TST_Individual_Servers " "] if { $srvr ne "" } { node $srvr 80 } else { HTTP::redirect "http://search.tst.co.uk/" } } }
- Pav_70755NimbostratusI've now managed to get this to work and have even submitted the Irule
when CLIENT_ACCEPTED { set default_pool [LB::server pool] } when HTTP_REQUEST { if { [TCP::local_port] eq "80" } { pool $default_pool } else { set srvr [findclass [TCP::local_port] $::TST_Individual_Servers " "] if { $srvr ne "" } { node $srvr 80 } else { pool $default_pool } } }
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