For more information regarding the security incident at F5, the actions we are taking to address it, and our ongoing efforts to protect our customers, click here.

Forum Discussion

ema_128890's avatar
ema_128890
Icon for Nimbostratus rankNimbostratus
Jun 29, 2016

Multiple http to https redirects

I have a VS setup with Layer 4 Performance and listening on https. I would like to redirect multiple sites to our internal servers. Here is what I have so far for one of the site.

 

when HTTP_REQUEST { switch -glob[string tolower [HTTP::host]] { "123.abc.com" { HTTP::redirect "" } } }

 

For some reason it just won't connect. Once I get this working I will be adding more sites to this.

 

Thank you.

 

18 Replies

  • Hi,

    Here the working irule :

    when HTTP_REQUEST { 
        switch -glob [string tolower [HTTP::host]] { 
            "123.abc.com*" { 
                HTTP::redirect "https://server1/reports" 
            } 
        } 
    }
    

    If you need to redirect the user to server1, you need the

    HTTP::redirect
    or
    HTTP::respond
    commands.

    But if you need to forward the traffic to server1, you will need to add the following command :

    node server1 443

    • ema_128890's avatar
      ema_128890
      Icon for Nimbostratus rankNimbostratus
      Thank you for the quick reply. I have tested the irule and it is still not working. Maybe to give further information is that the ssl is pass-through to the web server.
    • Yann_Desmarest's avatar
      Yann_Desmarest
      Icon for Cirrus rankCirrus
      I forget to mentioned that I think HTTP events are not available when you have a Performance L4 VS. You need to configure a Standard VS with SSL bridging (clientssl and serverssl profiles)
  • Hi,

    Here the working irule :

    when HTTP_REQUEST { 
        switch -glob [string tolower [HTTP::host]] { 
            "123.abc.com*" { 
                HTTP::redirect "https://server1/reports" 
            } 
        } 
    }
    

    If you need to redirect the user to server1, you need the

    HTTP::redirect
    or
    HTTP::respond
    commands.

    But if you need to forward the traffic to server1, you will need to add the following command :

    node server1 443

    • ema_128890's avatar
      ema_128890
      Icon for Nimbostratus rankNimbostratus
      Thank you for the quick reply. I have tested the irule and it is still not working. Maybe to give further information is that the ssl is pass-through to the web server.
    • Yann_Desmarest_'s avatar
      Yann_Desmarest_
      Icon for Nacreous rankNacreous
      I forget to mentioned that I think HTTP events are not available when you have a Performance L4 VS. You need to configure a Standard VS with SSL bridging (clientssl and serverssl profiles)