与我们其中一个网站的许多连接

与我们其中一个网站的许多连接

我们托管多个网站,并使用 Nginx 作为 SSL 终止器。所有流量都通过 Nginx 代理到后端服务器。netstat 显示,我们的某个网站有许多连接:

# netstat -ntp|grep nginx |wc -l
1041

当我检查网站访问日志时,我发现有太多的 IP 地址在网站上进行搜索:

部分日志:

71.89.120.4 - - [14/Nov/2019:09:23:53 +0330] "GET /?s=Creed+II HTTP/1.1" 200 10481 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:60.0) Gecko/20100101 Firefox/60.0"
105.228.133.215 - - [14/Nov/2019:09:23:53 +0330] "GET /?s=Noelle HTTP/1.1" 200 13024 "-" "Mozilla/5.0 (Windows NT 6.3; WOW64; rv:58.0) Gecko/20100101 Firefox/58.0"
170.84.11.136 - - [14/Nov/2019:09:23:53 +0330] "GET /?s=Playing+with+Fire HTTP/1.1" 200 9130 "-" "Mozilla/5.0 (Windows NT 6.3; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/64.0.3282.140 Safari/537.36"
189.216.166.67 - - [14/Nov/2019:09:23:54 +0330] "GET /?s=Red+Shoes+and+the+Seven+Dwarfs HTTP/1.1" 200 9246 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/64.0.3282.140 Safari/537.36"
47.209.3.178 - - [14/Nov/2019:09:23:58 +0330] "GET /?s=Good+Boys HTTP/1.1" 200 9158 "-" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_5) AppleWebKit/603.2.4 (KHTML, like Gecko) Version/10.1.1 Safari/603.2.4"

我可以在 htacess 中阻止请求,但请求会被传送到 Web 服务器并导致资源占用!

我怎样才能阻止这种请求?

相关内容