在本地测试静态 html 文件的时候问没有问题。
静态 html 时 nginx 配置
在 http 块
limit_req_zone $binary_remote_addr zone=req_zone:1m rate=1r/m;
1 分钟限制访问 1 次
在 server 块
    location /test.html {
        root /home/admin/www;
        limit_req zone=req_zone;
        }
        
python 使用 requests 压测,除了第一次返回 200 ,其余都是 503 。
而在 wordpress 的 nginx 里面: http 块不变,
server 块如下:
    location ~ \.php$ {
        root           /var/www/html;
        fastcgi_pass   php-mysql:9000;
        fastcgi_index  index.php;
        fastcgi_param  SCRIPT_FILENAME  $document_root$fastcgi_script_name;
        include        fastcgi_params;
    }
    
    location ~ \wp-login.php$ {
     limit_req zone=req_zone;
     }
同样的压测代码,发现限制不起作用。 请教下运维的高手同学,哪里出问题了。
这是一个专为移动设备优化的页面(即为了让你能够在 Google 搜索结果里秒开这个页面),如果你希望参与 V2EX 社区的讨论,你可以继续到 V2EX 上打开本讨论主题的完整版本。
V2EX 是创意工作者们的社区,是一个分享自己正在做的有趣事物、交流想法,可以遇见新朋友甚至新机会的地方。
V2EX is a community of developers, designers and creative people.