nginx 上的 limit_req 不起作用

nginx 上的 limit_req 不起作用

我正在使用 Ubuntu 服务器 14.04,上面有 apache + nginx 代理。我尝试在 /etc/nginx-sp/nginx-sp.conf 中设置 limit_req

像这样:

http {
    limit_req_zone $binary_remote_addr zone=one:1m rate=10r/s;
    limit_req zone=one burst=50 nodelay;
.....

当我进行这个测试时,什么也没有发生:

ab -c 1000 -n 1000000 http://example.com

/var/log/nginx-sp 中根本没有关于 limit_req 的日志

似乎没有应用 limit_req 或者我的模拟 DDoS 攻击不够好。

我的cloudflare 已关闭。

相关内容