Forum Discussion

harry_35316's avatar
harry_35316
Icon for Nimbostratus rankNimbostratus
Jul 16, 2013

iRule for redirect from http standard port to https nonstandard port without http::redirect

i have a similar requirement where in i need to redirect the request on one common http virtual server to multiple https vips on the same load balancer based on the HTTP::host value in the http header. But the redirection should not be visible to the end user. So the request comes on one http standard port VIP on the load balancer which needs to be redirected to a https nonstandard port VIP on the same load balancer.

 

 

For example. I receive a http request on vip x.x.x.x:80 with HTTP::host= www.myname.com

 

We need to redirect it to another vip on the same load balancer y.y.y.y:12000 . But this redirection(change of host value)should not be visible to the end user. I was thinking to write a http::header replace with https redirection..any inputs on this is appreciated.

 

1 Reply

  • There are at least twp possible solutions:

    1. Send the traffic to a pool. The pool would have servers listening on your specified port, port translation enabled on the VIP config, and optionally a server SSL profile if going to an HTTPS server. If multiple pools are needed, use an iRule to switch between them based on something in the request (ie. different Host headers).

    2. Send the traffic to another virtual server using "VIP targeting". With an iRule, specify the virtual's name using the virtual command in the HTTP_REQUEST event. For example:

    
    when HTTP_REQUEST {
         virtual "my_internal_virtual"
    }
    

    If the internal virtual is an HTTPS VIP, apply a server SSL profile to the external VIP.