I want to limit the HTTP::request rate from one client, Below is my iRules:
when HTTP_REQUEST {
if { [HTTP::uri] == "/user/loginPub.jsp" } {
if { [clock seconds] == $cur_time } {
if { $req_count > 1 } {
HTTP::respond 501 content "request blocked."
}
incr req_count
return
}
set req_count 0
set cur_time [clock seconds]
}
}
But when I apply it to a virtual-server, the requests with that uri (/user/loginPub.jsp) reseted. Chrome shows "connection reset".
why it doesn't work? where is wrong ? Thanks