We have an environment that required users to hit VIP that uses F5 to offload SSL. If users request for /login, we need to rewrite host information and re-encrypt traffic back to pool using certificate specific to that host and not original certificate used in called VIP. Business need requires second host name needs to be hidden. We have tried enabling and disabling SSL:: <> serverside, adding server side certificate profiles to VIP or within iRule. Any changes to using standard redirect to second host name returns page not found.
FYI, in version 11.4 and above, there are 1) Rewrite Profiles, and 2) Local Traffic Policies which do similar operations. I don’t either of them will do what you want in terms of changing both the header and the body or responses.
If you’re referring to simply adding a server SSL profile for when the request flow has to go to the server2 pool, the easiest method is to apply the server SSL profile to the virtual server configuration and disable it for the regular traffic. You can’t use the SSL::enable and SSL::disable commands unless an SSL profile is applied to the VIP. Something like this:
when CLIENT_ACCEPTED {
set default_pool [LB::server pool]
}
when HTTP_REQUEST {
switch -glob [string tolower [HTTP::uri]] {
"/login/login.html" {
pool login_pool
HTTP::header replace Host "server2.mycompany.com"
}
default {
pool default_pool
SSL::disable serverside
}
}
}