Forum Discussion

Martin_Kaiser_1's avatar
Martin_Kaiser_1
Icon for Nimbostratus rankNimbostratus
Oct 26, 2005

[HTTP::uri] requires FASTHTTP profile?

Hi guys,

 

 

I'm having trouble extending an existing iRule on a Loadbalancer running BIG-IP 9.1.0 Build 6.2

 

I have a virtual server using a slightly (only fallback host) modified http-profile.

 

The VS already has a rule bound to it that looks like this:

 

 

when HTTP_REQUEST {
if { [HTTP::uri] starts_with "/maintenance/" } {
pool maintenance_pool
}
elseif { [HTTP::uri] starts_with "/tracking_engine/" } {
pool tracking
}
else { 
pool http_defaultpool
}
}

 

 

This one works properly. But since the fallback functions using profiles are too limited, I wanted to append the following to the rule:

 

 

when LB_FAILED {
   if [regexp {&view=([a-zA-Z]+)} [HTTP::uri] viewstring portalview] {
      HTTP::redirect https://some.webserver.com/maintenance/$portalview
   }
   elseif [regexp {/irj/portal/([a-zA-Z]+)} [HTTP::uri] uri_part portalview] {
      HTTP::redirect https://some.webserver.com/maintenance/$portalview
   }
   elseif { {[HTTP::uri] not starts_with "/maintenance"} and {[HTTP::uri] not starts_with "/tracking_engine"} } {
      set portalview [getfield $uri "/" 2]
      HTTP::redirect https://some.webserver.com/maintenance/$portalview
   }
}

 

 

There are three types of possible URIs that contain the customer ID:

 

1. the string &view=customer

 

2. /irj/portal/customer?target=xyz

 

3. /customer as starting page

 

 

Adding this to the rule, the loadbalancer complains about a missing FASTHTTP profile:

 

 

01070394:3: HTTP::uri in rule (dynamic_fallback) requires an associated FASTHTTP profile on the virtual server (some.webserver.com)

 

 

Inserting the new code to a second rule and binding this as additional resource in the iRule field results in the same error.

 

 

Now I wonder why I am allowed to use [HTTP::uri] in the first part of the rule, but not in second! I cannot change the profile to a FASTHTTP profile, because I need cookie persistence and SSL termination for the pool of webservers.

 

 

Any suggestions how to get rid of this problem?

 

Thanks in advance!

 

 

Martin
  • First of all, I had to place the second regexp into braces in order to get the BigIP accept it... Using the provided version, it complains about an unknown function a-zA-Z!

     

     

    But even binding the changed rule to the VS actually results in the same error :-(

     

     

    Any more ideas?
  • unRuleY_95363's avatar
    unRuleY_95363
    Historic F5 Account
    I believe there was a bug in 9.1 with regard to some of the HTTP commands in the LB_FAILED event. The work-around would be to put the uri into a variable in the HTTP_REQUEST event and then use that variable in the LB_FAILED event.
  • I have opened a case at F5 techsupport for this issue. They say the problem will be fixed in the next release and suggested the same workaround as mentioned above. Additionally, it would also be possible to use the old http_uri function, which is still included in Version 9 and is not planned to be removed.

     

     

    Thanks for help!

     

     

    Rgds,

     

    Martin