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

Diamonddust_248's avatar
Diamonddust_248
Icon for Nimbostratus rankNimbostratus
Mar 14, 2016

iRule buttons not showing properly

The code works but not entirely as I had hoped. I noticed that on switch based websites the buttons on several components aren't showing properly. If it might help these are login(key button), search(looking glass) and contact page(3 stripes). I think the cause might be due the websites behind these buttons are in https but not sure if this is possible to fix.

 

    when HTTP_REQUEST {
    switch -glob [string tolower [HTTP::host][HTTP::uri]] {
        "www.abc.com/xyz/def*" -
        "www.abc.com/xyz*" -
        "www.abc1.com/xyz/def*" -
        "www.abc2.com/xyz/def*" - 
        "www.abc3.com/xyz/def*" -
        "www.abc4.com/xyz/def*" - 
        "www.abc5.com/xyz/def*" - 
        "www.abc6.com/xyz/def*" -
        "www.abc7.com/xyz/def*" -
        "www.abc8.com/xyz/def*" {
            return
        } 
        default {
            HTTP::respond 302 location "https://[HTTP::host][HTTP::uri]"
        }
    }
}

Thank you in advance!

 

1 Reply

  • If the website is being served on HTTPS and those resources are being accessed by HTTP, then you're going to run into a mixed content issue where the browser won't allow you to load insecure content from a secure page. The best way to fix this is to use HTTP for all resources on the page. Once other option would be to use

    //
    instead of
    http://
    for references because it will pick up on the pages protocol itself. So for example, an image might look like
    instead of
    .

    If you can't change the website, then you may want to look at using an iRule and stream profile to rewrite http:// to https:// in your page(s).

    You can also add some logging in your iRule to see if there's something else going on. (Check the developers console in your browser too in order to verify the mixed content error)

    when HTTP_REQUEST {
        log local0. "HostUri: '[HTTP::host][HTTP::uri]'"
        switch -glob [string tolower [HTTP::host][HTTP::uri]] {
            "www.abc.com/xyz/def*" -
            "www.abc.com/xyz*" -
            "www.abc1.com/xyz/def*" -
            "www.abc2.com/xyz/def*" - 
            "www.abc3.com/xyz/def*" -
            "www.abc4.com/xyz/def*" - 
            "www.abc5.com/xyz/def*" - 
            "www.abc6.com/xyz/def*" -
            "www.abc7.com/xyz/def*" -
            "www.abc8.com/xyz/def*" {
                log local0. "  Found it! Returning"
                return
            } 
            default {
                log local0. "  Didn't find it. Redirecting"
                HTTP::respond 302 location "https://[HTTP::host][HTTP::uri]"
            }
        }
    }