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

我在我的VPS中使用NGINX作为Web服务器,我想将其配置为阻止泛洪请求.我找到了HttpLimitReqModule模块,但我需要避免向用户发送回复.

如果请求数高于设置,我看到模块发回503 http错误.我可以阻止向用户发送回复吗?我会关闭连接.

(我认为它快得多)

谢谢

最佳答案
http://nginx.org/en/docs/http/ngx_http_rewrite_module.html#return

Stops processing and returns the specified code to a client. The
non-standard code 444 closes a connection without sending a response
header.

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;可以帮助.

dawei

【声明】:唐山站长网内容转载自互联网,其相关言论仅代表作者个人观点绝非权威,不代表本站立场。如您发现内容存在版权问题,请提交相关链接至邮箱:bqsm@foxmail.com,我们将及时予以处理。