Nginx http_user_agent 防禦 ab 等

丶小炒肉發表於2016-05-31

日誌出現大量:

xxxxxxxxxxxxx - - [04/Jul/2013:23:37:49 +0800] "GET /1000.html HTTP/1.0" 200 56471 "-" "ApacheBench/2.3" -

xxxxxxxxxxxxx - - [04/Jul/2013:23:37:49 +0800] "GET /1000.html HTTP/1.0" 200 56471 "-" "ApacheBench/2.3" -

 

 

Nginx 設定..Nginx.conf 新增

 

 

       if ($http_user_agent ~ ApacheBench|WebBench|Jmeter|must-revalidate){

       return 403;

       }

 

重啟~Nginx 以後~~再檢視日誌

 

xxxxxxxxxxxxxx - - [05/Aug/2013:08:33:18 +0800] "GET / HTTP/1.0" 403 168 "-" "ApacheBench/2.3" -

xxxxxxxxxxxxxx - - [05/Aug/2013:08:33:18 +0800] "GET / HTTP/1.0" 403 168 "-" "ApacheBench/2.3" -

 

 

如果 ... DDOS 的話....

 

=0=   檢視特徵..... proxy_pass  http://www.google.com    打的死麼~~

相關文章