
我使用 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 已關閉。