Michael_60521
Feb 12, 2013Nimbostratus
Redirect TCP connection based on hostname
hi.
I am trying to redirect a connection based on the hostname that the request came in.
I have a VS on tcpport 5222 (special programe made for us) It is not http, so I cannot use this :
when HTTP_REQUEST {
if {[HTTP::host] eq "1.domain.com" } {
node 10.20.61.21:5222
} elseif {[HTTP::host] eq "2.domain.com" } {
node 10.21.61.21:5222
} elseif {[HTTP::host] eq "3.domain.com" } {
node 10.22.61.21:5222
} elseif {[HTTP::host] eq "4.domain.com" } {
node 10.23.61.21:5222
} elseif {[HTTP::host] eq "5.domain.com" } {
node 10.24.61.21:5222
} elseif {[HTTP::host] eq "6.domain.com" } {
node 10.25.61.21:5222
} else {
HTTP::redirect "https://domain.com"
}
}
If I use the above, it will redirect to https://domain.com ...
what to use insted of HTTP::host ?? to catch the tcp-port 5222 and send it to the right node ??
Michael