Forum Discussion
robellis_205946
Nimbostratus
Jun 11, 2015multiple irule processing
I have 2 irules linked to a virtual server.
irule 1 redirects to a local maintenance page if all of the nodes our down.
when HTTP_REQUEST { if { [active_members [LB::server pool]] < 1 } { ...
nitass
Employee
Jun 11, 2015when request matches multiple actions, it may make an unexpected result.
case 1
[root@ve11c:Active:In Sync] config tmsh list ltm rule qux
ltm rule qux {
when HTTP_REQUEST {
HTTP::respond 200
HTTP::redirect "http://www.google.com"
}
}
[root@ve11c:Active:In Sync] config curl -I http://172.28.24.10
HTTP/1.0 200 OK
Server: BigIP
Connection: Keep-Alive
Content-Length: 0
[root@ve11c:Active:In Sync] config cat /var/log/ltm
Jun 11 17:16:21 ve11c err tmm[10748]: 01220001:3: TCL error: /Common/qux - Operation not supported. Multiple redirect/respond invocations not allowed (line 1) invoked from within "HTTP::redirect "http://www.google.com""
case 2
[root@ve11c:Active:In Sync] config tmsh list ltm rule qux
ltm rule qux {
when HTTP_REQUEST {
HTTP::redirect "http://www.google.com"
HTTP::respond 200
}
}
[root@ve11c:Active:In Sync] config curl -I http://172.28.24.10
HTTP/1.0 302 Found
Location: http://www.google.com
Server: BigIP
Connection: Keep-Alive
Content-Length: 0
[root@ve11c:Active:In Sync] config cat /var/log/ltm
Jun 11 17:17:51 ve11c err tmm[10748]: 01220001:3: TCL error: /Common/qux - Operation not supported. Multiple redirect/respond invocations not allowed (line 1) invoked from within "HTTP::respond 200"
you may use "event" command to disable other events after condition matches.
event
https://devcentral.f5.com/wiki/iRules.event.ashxHelp guide the future of your DevCentral Community!
What tools do you use to collaborate? (1min - anonymous)Recent Discussions
Related Content
DevCentral Quicklinks
* Getting Started on DevCentral
* Community Guidelines
* Community Terms of Use / EULA
* Community Ranking Explained
* Community Resources
* Contact the DevCentral Team
* Update MFA on account.f5.com
Discover DevCentral Connects