Gbps_31870
Aug 14, 2011Nimbostratus
using localvar to manage iRules process flow
Hi All,
I really appreciate your efforts in this wouderful forum.
I have a question which might solve the logs generated for TCL error for multiple redirection.
I have two irules, irule1 and irule2, and both are for HTTP redirection. I know that event disable is based on the connection rather than request which might cause subsequent requests bypassing that event, so I'm trying to avoid it.
irule 1
when HTTP_REQUEST {
switch [string tolower [HTTP::path]] {
"/xyz" {
HTTP::redirect "http://www.example.com/dir1/dir2/xyz"
set stop_processing 1
}
}
}
irule 2
when HTTP_REQUEST {
if {($stop_processing != 1)
body
}
}
My goal is to skip irule 2 if and only if irule 1 is processed for that connection, my questions are:
1- if there is no hit for irule 1, will be there any issues that prevent irule 2 from processing the request, as the localvar (stop_processing) has no value?
2- The localvar is per connection, so no need to worry about multiple/parallel connections, but what about subsequent HTTP_REQUEST during the same connection, is it possible to create irule 3 as below and associate it with the same VS to chenge localvar value.
when HTTP_RESPONSE {
set stop_processing 0
}
BR,