DFeike_160744
Jan 06, 2015Nimbostratus
referencing the VS default pool as destination in iRule
Hi Fellows 🙂
my customer has the following requirement, the webservice shall be only available via https and ssloffload and in case http traffic arrives, a redirect VS shall do the job, except for certain domains. If the one of the exceptions hits the port80 redirect VS the traffic shall be forwarded to the default pool of the VS in http.
so here is, what i've come up with(untested)
when HTTP_REQUEST {
switch [string tolower [HTTP::host]] {
"www.domain-a.de" { pool pool_mypool_prod-80 }
"www.domain-b.de" { pool pool_mypool_prod-80 }
"www.domain-c.de" { pool pool_mypool_prod-80 }
"default" { HTTP::redirect "https://[HTTP::host][HTTP::uri]" }
}
}
Since i'd like to use the same iRule on preproduction VS and the production VS it would be cool if can reference the assigned default pool of the VS in the iRule.
Thanks in advance David