Forum Discussion
xin_li_90490
Nimbostratus
Mar 25, 2005limit frequent http GET
my website use bigip3400. and now a problem occured.someone from one session accessed our website, but about 3 http gets in 1 second. how can I limit it?
- bl0ndie_127134Historic F5 AccountPlease refer to this posting, I think it may be what you are looking for.
- xin_li_90490
Nimbostratus
I had seen the subject and I think that is not the same with my problem.that is how to limit current connections from one ip address.My problem is how to limit http GET from one connection. how can I judge when the http GET finished? whether or not I need to set a time to limit the amount of http GET at that time? - bl0ndie_127134Historic F5 AccountTypically HTTP 1.x clients try to reuse the TCP connection so it’s quite common to see multiple GET requests on the same connection; some within a very short amount of time.
when HTTP_RESPONSE { if {[HTTP::request_num] > 2} { HTTP::close } }
- xin_li_90490
Nimbostratus
if I use this rule, does it work that the keep-alive function? - xin_li_90490
Nimbostratus
now the guy use a search engine to access our website. so he send lots of http GET in one connection. so I want to limit it, but I expect the rule will not affect the common user. what can I do? - unRuleY_95363Historic F5 AccountIf you are only concerned about limiting the number of requests on the current connection, you can do something like this:
when HTTP_REQUEST { set cur_time [clock seconds] if { [HTTP::request_num] > 1 } { if { $cur_time == $start_time } { if { $reqs_sec > 3 } { HTTP::respond 503 Retry-After 2 } incr reqs_sec return } } set start_time $cur_time set reqs_sec 0 }
- xin_li_90490
Nimbostratus
thank you very much. I will try it and tell you results.
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