Forum Discussion

Michael_McCorm1's avatar
Michael_McCorm1
Icon for Nimbostratus rankNimbostratus
Apr 22, 2005

Redirect Via Rules Hangs then timeout

I am attempting to redirect the incoming url to place the context root in the url. I have written the following rule but when i apply the rule i recieve the the ssl cert but then it hangs eventually timing out.

 

 

Any help would be appreciated

 

 

if (http_uri ends_with "wbaTermsAccept"

 

or http_uri ends_with "wbaTermsReview"

 

or http_uri ends_with "cdaTermsAccepts"

 

or http_uri ends_with "cdaProfileAccept"

 

or http_uri ends_with "cdaTermsReview"

 

or http_uri ends_with "cbeTermsAccept"

 

or http_uri ends_with "cbeTermsReview") {

 

redirect to "https://%h/wbacustomer/%u"

 

}

 

else {

 

use ( uatwbacustomer7061 )

 

}

 

 

What i need it to do is redirect like the following

 

 

https://my.url.com/wbaTermsAccept -> https://my.url.com/wbacustomer/wbaTermsAccept

 

 

Our Big IP is currently running BIG-IP Kernel 4.2PTF-10 Build95

 

 

Thanks in advance
  • I think you have a loop - if the uri ends with "wbaTermsAccept", it will match both:

     

     

    https://my.url.com/wbaTermsAccept

     

    -AND-

     

    https://my.url.com/wbacustomer/wbaTermsAccept

     

     

    Grab a tool like livehttpheaders for Firefox, ieHTTPheaders for IE, or use wget to dump your headers and confirm it. You'll know it when you see it, especially if you use one of the browser based tools.

     

     

    You should be able to deal with this by either adding the wbacustomer portion to the http_uri:

     

     

    http_uri contains "wbacustomer" and http_uri ends_with "wbaTermsAccept"

     

     

    or you could use a regex to make sure you have wbaTermsAccept WITH wbacustomer/ in front of it.

     

     

    Hope this helps.

     

     

    Matt

     

     

  • Scott_Tennican_'s avatar
    Scott_Tennican_
    Historic F5 Account
    MattCauth is correct that you have a loop.

    But, the solution is to first test whether the redirect has already occurred. Also, you can speed you expression up using a class.

     
     class my_class { 
        "/wbaTermsAccept" 
        "/wbaTermsReview" 
     } 
     rule myrule { 
        if (http_uri starts_with "/wbacustomer") { 
           use pool uatwbacustomer 
        } 
        else if (http_uri == one of my_class) { 
           redirect to "http://%h/wbacustomer/%u" 
        } 
        else { 
           use pool uatwbacustomer 
        } 
     } 
     
  • All,

     

     

    Thanks for the posts unfortunately we have gone another route to do the same but i will be testing you suggestions on a lab in the event this would ever pop up again
  • It's our pleasure and don't hesitate to post any questions you have in the future.

     

     

    -Joe