Forum Discussion

Moe_Jartin's avatar
Jan 12, 2009

F5 Sending TCP RESET

I have an iRule with two parts. The first part prepends a root folder to requests to certain URIs and that is working fine. The second part removes that same root folder from responses from the server. When I apply this second part of the irule and try the VIP I get a TCP RESET. I initialy thought that this was coming from the server but I did a capture on both sides of the F5 and noticed that it is the F5 that is sending the RESETs to both the browser and the server.

 

 

Here is the part of the iRule the appears to caus ehte RESET:

 

 

 

when HTTP_RESPONSE {

 

Remove /contextroot from HTTP responses

 

if {[[HTTP::header value "Content-Type"] contains text]} {

 

STREAM::expression "@/contextroot@@"

 

STREAM::enable

 

} else {

 

STREAM::disable

 

}

 

}

 

 

 

For the full iRule see http://devcentral.f5.com/Default.aspx?tabid=53&forumid=5&postid=31267&view=topic.

 

 

So the question, Why is the F5 resetting the TCP session? I do have Response Rechunk set in the http profile. Any other ideas?

2 Replies

  • When you see a reset being sent to the client and/or server while testing an iRule, you can check the /var/log/ltm log file for any related errors. I expect you'll see an error about "1" or "0" not being a valid command. If you replace this:

     

     

    [[HTTP::header value "Content-Type"] contains text]

     

     

    with this:

     

     

    [HTTP::header value "Content-Type"] contains text

     

     

    it should work. The braces act like backticks in *nix to execute the code within them. [HTTP::header value "Content-Type"] contains text would evaluate to 0 or 1 and then the outer braces would try to execute that value as a command.

     

     

    Aaron
  • GUI wouldn't take:

     

     

    [HTTP::header value "Content-Type"] contains text

     

     

    I get this error:

     

     

    error: line 81: [parse error: PARSE syntax 2294 {syntax error in expression [HTTP::header value Content-Type] contains text: variable references require preceding $}] [{[HTTP::header value Content-Type] contains text}]

     

     

    but i got it to take:

     

     

    [HTTP::header value "Content-Type"] contains "text"

     

     

    and it appears to be working.

     

     

    I LOVE YOU HOOLIO!!!! :-)