Forum Discussion

jandg_209076's avatar
jandg_209076
Icon for Nimbostratus rankNimbostratus
Jan 19, 2016

Need iRule for Redirect http to different pool of https web servers with certificate terminated in web servers

Hi Guys,

I need help to Need iRule for Redirect http to different pool of https web servers with certificate terminated in web servers.

I have 4 sites hosted in 2 servers with URL's below. Certificate are terminated at Server side pool_Server1 aaa.com/www.aaa.com bbb.com/www.bbb.com pool_Server2 ccc.com/www.ccc.com ddd.com/www.ddd.com

I used this reference, when user access http i have iRule to redirect them to https. But i dont have idea how to redirect to pool of servers if current are https. I save this link below as reference. https://devcentral.f5.com/questions/irule-for-virtual-server-to-redirect-to-different-pool

when CLIENT_ACCEPTED { Save the name of the VS default pool set default_pool [LB::server pool] } when HTTP_REQUEST {

switch -glob "[string tolower [HTTP::host][HTTP::path]]" {
    "*seattle.gov/util*" {
        pool spu-util-pool
    }
    default {
        pool $default_pool
    }
}

}

Please advice. Thanks

2 Replies

  • Hi Artorukt,

    if you need to perform content switching decisionbased on the provided HTTP request headers, then you have to utilize Layer7 inspection (aka. attaching a HTTP-Profile to your virtual server). For HTTPS-sites this would have the fundamental requirement to also terminiate the SSL conection, before you're able to inspect the contained HTTP request information.

    Once you have terminated the SSL-session on your F5, you could integrate your iRule to parse the requested

    [HTTP::host]
    and
    [HTTP::path]
    information and then select a destination pool based on the requested information. When forwarding the request to your webservers, you may want to reencrypt the traffic again to provide end-to-end alike security (aka. HTTPS-to-HTTPS bridging scenario).

    Cheers, Kai

  • Hi Kai,

     

    Thanks, can share me a link that have config template. Or sample iRule config or guide.

     

    I appreciate your help. Tnx