Forum Discussion

cvitale_103614's avatar
cvitale_103614
Icon for Nimbostratus rankNimbostratus
Feb 08, 2009

Redirecting https request

Hello,

 

Setting up a single BigIP 1600 for a client. Fairly unfamiliar with BigIP and need some help with a client request.

 

Client wants to redirect incoming request from HTTPS://XYZ.XYZ.ORG to HTTPS://XYZ.XYZ/xlWebApp/

 

So the client wants to append the incoming HTTPS request to virtual server and append "xlWebApp/" and direct to VS pool defined apps servers.

 

I know this redirect is normally handled in the application servers but the client is requesting this be done by the load balancer.

 

Not sure what "xlWebApp/" actually points to at this time.

 

Any help / examples much appreciated. Thanks.

5 Replies

  • Here is an untested example that depicts what you are trying to do, which is HTTPS to HTTPS redirects

      
     when HTTP_REQUEST {  
     if { ([TCP::local_port] == 443) && ([HTTP::host] equals "XYZ.XYZ.ORG") } {   
     HTTP::respond 301 Location "HTTPS://XYZ.XYZ/xlWebApp/"  
     pool vs_app_server  
     }  
     }  
     

    NOTE: MAke sure you have a valid cert that pics up XYZ.XYZ. Otherwise you will get that annoying invalid cert message when you are being redirected

    Hope this helps

    CB
  • And, just to clarify, this won't work at all unless you are doing SSL offload on the BIG-IP. If you are just passing 443 through to the webserver the iRule can't see any of the traffic.

     

     

    Denny
  • I have a similar requirement, but this is SSL pass-through.

     

     

    I want to basically check the source IP coming in then based on this map to a specific server.

     

     

    Example:

     

     

    If Src IP == 1.1.1.1 then goto Server1

     

     

     

    Would probably have a dataset with the IP's listed, then reference this in the irule.
  • Thanks for the feedback. I also need to ensure that during the redirect, the original value of the HTTP REFERRER is preserved and does not change. thanks.

     

     

    If that needs to be included as part of the iRule, to preserve that value, much appreciated if you can give me a rough example. thanks.

     

  • Crockettv,

     

     

    It would probably be clearer to create a new post for your question.

     

     

    I'm pretty sure the browser will set the Referer header value to the URI of the request which generated the redirect. So if the first request is to http://www.example.com/first_page.html and the client is redirected to http://www.example.com/second_page.html, the Referer in the request to http://www.example.com/second_page.html will be http://www.example.com/first_page.html. I don't think there is a way to modify what the client sets the Referer header to.

     

     

    I suppose you could rewrite the request and not redirect the request to the first page in order to preserve the Referer header value.

     

     

    Grimish, if you create a new post, you should be able to get an answer to your question. Here are a few related wiki pages:

     

     

    IP::addr (Click here)

     

    matchclass (Click here)

     

     

    Aaron