Forum Discussion

haxzorian_35595's avatar
haxzorian_35595
Icon for Nimbostratus rankNimbostratus
Aug 21, 2012

Strange Redirect Behavior

We have a webpage that our technicians use when on customer sites to pair devices. The page itself is just an HTML blob with some CSS and a few java script files that execute when triggered.

 

 

 

If we bring up the website via any device, android or laptop, directly from the site everything works fine. However, when we put it behind the F5 using a redirect iRule. The HTML loads, the CSS loads, but the javascript won't execute.

 

 

Is there any reason that an iRule to redirect to a pool wouldn't allow the page to exectue javascript?

 

 

iRule is attached.v
  • I've seen javascript fail to load when the page was on https, but the javascript had generated some code that created links back to the site that started with 'http://'.

     

     

    I don't have a concrete solution for you, other than to say that your iRule looks valid, but tools like Firebug are invaluable in situations like this. Enable firebug, point your browser to the page in question, and look for errors.
  • Couple of things come to mind.

    First, as a best practice, you should include a "--" in your switch statement. This tells the switch command that there are no more arguments, so someone construct a request URI starting with a "-" character and break your rule.

    Second, your switch is not using a "-glob" argument. If you don't have a default pool on the VIP and the request URI doesn't exactly match "/devicepairingstage" or "/devicepairing", the LTM has nowhere to send the traffic.

    Perhaps you should try something like this:

    
    timing on
    when HTTP_REQUEST {
      switch -glob -- [string tolower [HTTP::path]] {
        "/devicepairingstage*" {
          pool ianappsstage-pool-https
          log local0.debug  "uri: [HTTP::uri]"
          log local0.debug  "[client_addr] hit devicepairingstage"
        }
        "/devicepairing*" { 
          pool ianapps-pool-https
          log local0.debug "uri: [HTTP::uri]"
        }
      }
    }