Forum Discussion

John_Lin_106399's avatar
John_Lin_106399
Icon for Nimbostratus rankNimbostratus
Jun 08, 2006

HTTP URI filtering and chunking?

I have a ticket open with Support but they've asked me to ask the question here.

 

 

The ticket is 274718.

 

 

I have a VIP setup to use a certain iRule using a Default Pool (lets say PoolC)

 

 

the iRule looks like below

 

 

when HTTP_REQUEST {

 

if { [HTTP::uri] starts_with "/a/" } {

 

pool PoolA }

 

elseif { [HTTP::uri] starts_with "/b/" }

 

{ pool PoolB }

 

 

What we're seeing is client would access the site, and when it hits a particular URL that starts with /a/, the traffic gets redirected to PoolA. However, any subsequent traffic does not get filter again (almost if it doesn't flow through the rule anymore) My expectation is if it does not match /a/ or /b/ then it should goto the default pool (PoolC) but that's not the case.

 

 

When examining the IIS log on PoolA and PoolB. It shows that it is getting traffic without the /a/ or /b/ in the URL request.

 

 

I saw other iRules examples that it has something about not allowing chunking.

 

 

when HTTP_REQUEST { Don't allow data to be chunked if { [HTTP::version] eq "1.1" } { if { [HTTP::header is_keepalive] } { HTTP::header replace "Connection" "Keep-Alive" } HTTP::version "1.0" }}

 

 

We do have http keepalive turned on on the back end iis. Do I need the conditions above for it to work properly?

 

 

please advise.

 

 

 

  • unRuleY_95363's avatar
    unRuleY_95363
    Historic F5 Account
    This is a standard mis-conception that if the control flows to the end of the event clause, the default pool will somehow be re-selected. This is not the case. Whatever the last pool selected remains in effect until otherwise changed. In order to do what you want you need to change the rule like so:
    when CLIENT_ACCEPTED {
       set default_pool [LB::server pool]
    }
    when HTTP_REQUEST {
       ...
       } else {
          pool $default_pool
       }
    }
  • unRuleY_95363's avatar
    unRuleY_95363
    Historic F5 Account
    PS: Chunking/not-chunking is completely unrelated and you probably don't need to do anything wrt chunking for your problem.
  • Thank you very much. I'll add the last catch all condition in. So once the catch all condition is set, what is the typical use for default pool? is it set there in no iRule is being used?

     

     

    thank you