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

Parveez_70209's avatar
Parveez_70209
Icon for Nimbostratus rankNimbostratus
Jun 11, 2014

How to Prevent xyz-da-bhht.abc.net from Redirecting to HTTPS

We are having an issue with the Intermittent URL: xyz-da-bhht.abc.net which is served by pool: ctx-da-bhht but this is mainly because of the handheld RF scanners, might be these are breaking while redirecting to HTTPS.

While the 2nd part is related to URL: xyz-da-app.abc.net served by pool : “ctx-da-app” which got the below extensions : which is working good.

Current Irule in place is the below:

when HTTP_REQUEST { check to see if traffic is sourcing from private circuit to not redirect to https

                            switch -glob [string tolower [HTTP::host]] {
                            "xyz-da-bhht.abc.net" { pool ctx-da-bhht }
                                                                                                               }

                            check for pages needing to not redirect to https
                            switch -glob [string tolower [HTTP::uri]] {
                                            "*/getxsl.asp*" { pool ctx-da-app }
                                            "*/RadSOMsgReceiverTri.asp*" { pool ctx-da-app }
                                            "*/RadSOFileTransfer.asp*" { pool ctx-da-app }
                                            "*/Reader.sod*" { pool ctx-da-app }
                                            "*/clockserver.asp*" { pool ctx-da-app }
                        "*/webapp*" { pool ctx-da-bhht }

                            default { HTTP::redirect https://[HTTP::host][HTTP::uri] }
                            }
            }

How to divide this Irule in two parts, keeping in mind xyz-da-bhht.abc.net should not redirect to HTTPS while others should have. Any suggestion.

Thanks and Regards Parveez

4 Replies

  • Hi,

    I think you have to use a flag to know if your host is bhht or not.

    when HTTP_REQUEST { check to see if traffic is sourcing from private circuit to not redirect to https
        set bhht 0;
        switch -glob [string tolower [HTTP::host]] {
            "xyz-da-bhht.abc.net" { pool ctx-da-bhht }
            $bhht=1;
        }
    
    check for pages needing to not redirect to https
        switch -glob [string tolower [HTTP::uri]] {
            "*/getxsl.asp*" { pool ctx-da-app }
            "*/RadSOMsgReceiverTri.asp*" { pool ctx-da-app }
            "*/RadSOFileTransfer.asp*" { pool ctx-da-app }
            "*/Reader.sod*" { pool ctx-da-app }
            "*/clockserver.asp*" { pool ctx-da-app }
            "*/webapp*" { pool ctx-da-bhht }
            default { 
                if { $bhht -eq 0) { 
                    HTTP::redirect https://[HTTP::host][HTTP::uri] 
                }
            }
        }
    }
    
    • Cory_50405's avatar
      Cory_50405
      Icon for Noctilucent rankNoctilucent
      In addition, make sure your match strings don't contain capital letters since you are converting the URI string to lowercase. Otherwise those conditions will never match.
  • Hi,

    I think you have to use a flag to know if your host is bhht or not.

    when HTTP_REQUEST { check to see if traffic is sourcing from private circuit to not redirect to https
        set bhht 0;
        switch -glob [string tolower [HTTP::host]] {
            "xyz-da-bhht.abc.net" { pool ctx-da-bhht }
            $bhht=1;
        }
    
    check for pages needing to not redirect to https
        switch -glob [string tolower [HTTP::uri]] {
            "*/getxsl.asp*" { pool ctx-da-app }
            "*/RadSOMsgReceiverTri.asp*" { pool ctx-da-app }
            "*/RadSOFileTransfer.asp*" { pool ctx-da-app }
            "*/Reader.sod*" { pool ctx-da-app }
            "*/clockserver.asp*" { pool ctx-da-app }
            "*/webapp*" { pool ctx-da-bhht }
            default { 
                if { $bhht -eq 0) { 
                    HTTP::redirect https://[HTTP::host][HTTP::uri] 
                }
            }
        }
    }
    
    • Cory_50405's avatar
      Cory_50405
      Icon for Noctilucent rankNoctilucent
      In addition, make sure your match strings don't contain capital letters since you are converting the URI string to lowercase. Otherwise those conditions will never match.