Forum Discussion
Jun 26, 2015
This project is currently for the redirection of specific traffic to the external site. Converting the local site to HTTPS will have to be done on a different project since the current servers are not configured to support SSL. This is what i have so far.
On the SSL VIP, i created a stream profile to modify the links on the hosted site.
profile stream test-staging-stream { target "@"
This is the irule that i currently have for redirecting the traffic to an external site.
rule abc-xyz-redirect4 {
when CLIENT_ACCEPTED {
set default_pool [LB::server pool]
}
when HTTP_REQUEST priority 100 {
switch -glob [string tolower [HTTP::uri]] {
"/careers/jobs*" {
set path [string map {/careers/jobs* /*} [URI::path [HTTP::uri]]][URI::basename [HTTP::uri]]
set uri $path[URI::basename [HTTP::uri]][URI::query [HTTP::uri]]
HTTP::path $path
set qry_location [string first "?" [HTTP::uri]]
if { $qry_location > 0 } {
set qry [string range [HTTP::uri] $qry_location end]
} else {
set qry ""
}
set uri ${path}/$qry
HTTP::uri $uri
log local0. "10>>being redirected to $path"
}
default {
log local0. "-->[HTTP::uri] $default_pool"
pool $default_pool
return
}
}
HTTP::header replace Host "www.xyz.com"
pool www.xyz.com-ssl
}
when HTTP_REQUEST priority 200 {
log local0. "25>>Outgoing path [HTTP::uri]"
}
}
This is the pool config:
pool www.xyz.com-ssl {
action on svcdown reselect
monitor all https
members xx.xx.xx.xx:https {}
This is the current VIP config
virtual test.abc.com-ssl {
snat automap
pool www.xyz.com-ssl
destination xx.xx.xx.xx:https
ip protocol tcp
rules abc-xyz-redirect4
profiles {
abc-TCP-Optimized {}
abc_Compression {}
serverssl {
serverside
}
test-staging-stream {}
wildcard.abc.com-new {
clientside
}
}
}
I still need to figure out how to use hostname/DNS lookup instead of the normal pool.
Thanks.