如何使用NGINX阻止洪泛请求?

我在我的VPS中使用NGINX作为Web服务器,我想configuration它来阻止洪泛请求。 我发现HttpLimitReqModule模块,但我需要避免发送回复给用户。

如果请求数量高于设置,我看到模块发回503 http错误。 我可以阻止将回复发送给用户吗? 我只是closures连接。

(我认为它快得多)

谢谢

http://nginx.org/en/docs/http/ngx_http_rewrite_module.html#return

停止处理并将指定的代码返回给客户端。 非标准代码444在不发送响应报头的情况下closures连接

http://nginx.org/en/docs/http/ngx_http_limit_req_module.html#limit_req_status

syntax: limit_req_status code; default: limit_req_status 503; 

所以limit_req_status 444; 可以帮助。

发出HTTP状态444.将不会返回标题,连接将被closures。

“444 No Response(Nginx)在Nginx日志中使用,表示服务器没有向客户端返回任何信息,并closures了连接(用于阻止恶意软件)。”

http://en.wikipedia.org/wiki/List_of_HTTP_status_codes#4xx_Server_Error

为了可靠的Web应用程序,考虑使用适当的HTTP状态代码。

RFC 6585第4节指出HTTP 429 – 太多的请求头应该用于速率限制的目的。