日期:2014-05-16  浏览次数:20977 次

如何nginx服务器最大请求次数
最近服务器遭受攻击,一个IP一秒内N次请求,请教如何设置访问限制。
以下是web访问日志:
222.187.222.118 - - [09/Jul/2013:19:00:52 +0800] "GET /forum-2-9.html HTTP/1.1" 499 0 "" "" -
122.72.124.53 - - [09/Jul/2013:19:00:52 +0800] "GET /forum-2-9.html HTTP/1.0" 502 166 "" "" 124.232.163.243
218.108.242.108 - - [09/Jul/2013:19:00:52 +0800] "GET /forum-2-9.html HTTP/1.1" 502 166 "" "" 124.232.163.243
222.141.199.150 - - [09/Jul/2013:19:00:52 +0800] "GET /forum-2-9.html HTTP/1.1" 502 166 "" "" 124.232.163.243
222.85.64.219 - - [09/Jul/2013:19:00:52 +0800] "GET /forum-2-9.html HTTP/1.0" 502 166 "" "" 124.232.163.243
190.151.122.38 - - [09/Jul/2013:19:00:52 +0800] "GET /forum-2-9.html HTTP/1.1" 502 166 "" "" 124.232.163.243
200.143.148.254 - - [09/Jul/2013:19:00:52 +0800] "GET /forum-2-9.html HTTP/1.1" 499 0 "" "" 124.232.163.243
61.19.252.92 - - [09/Jul/2013:19:00:52 +0800] "GET /forum-2-9.html HTTP/1.0" 502 166 "" "" 124.232.163.243
204.84.216.200 - - [09/Jul/2013:19:00:52 +0800] "GET /forum-2-9.html HTTP/1.1" 502 166 "" "" 124.232.163.243
60.190.136.90 - - [09/Jul/2013:19:00:52 +0800] "GET /forum-2-9.html HTTP/1.1" 502 166 "" "" 124.232.163.243
178.208.255.123 - - [09/Jul/2013:19:00:52 +0800] "GET /forum-2-9.html HTTP/1.1" 502 166 "" "" 124.232.163.243, 

------解决方案--------------------
http://kimnote.com/2013/06/apache%E9%98%B2ddos%E6%A8%A1%E5%9D%97mod_evasive%E7%9A%84%E5%AE%89%E8%A3%85%E9%85%8D%E7%BD%AE%E5%92%8C%E4%BD%BF%E7%94%A8/
 这个是apache版本的,查看nginx版本吧。