加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 运营中心 > Nginx > 正文

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

发布时间:2020-12-13 21:13:06 所属栏目:Nginx 来源:网络整理
导读:我在我的VPS中使用NGINX作为Web服务器,我想将其配置为阻止泛洪请求.我找到了HttpLimitReqModule模块,但我需要避免向用户发送回复. 如果请求数高于设置,我看到模块发回503 http错误.我可以阻止向用户发送回复吗?我会关闭连接. (我认为它快得多) 谢谢 最佳答

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

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读