国产av日韩一区二区三区精品,成人性爱视频在线观看,国产,欧美,日韩,一区,www.成色av久久成人,2222eeee成人天堂

nginx random response function
我想大聲告訴你
我想大聲告訴你 2017-05-16 17:25:34
0
2
641

When the client interacted with the server, there was a timing design error, which caused the server to receive more than 300,000 requests in 10 minutes. The pressure on the PHP backend increased instantly and caused it to collapse.

The current solution is that since repeated requests within a short period of time obtain the same content, requests with special parameters are directly dropped at the Nginx layer and no results are returned directly.

code show as below

shell    if ( $query_string ~ "api=(getpush|remove)")
    {
        return 200 '{"resultStatus":1,"allCount":0,"data":[]}';
        break;
    }

This solution is not perfect, for example, it only blocks 90% of requests, or it only takes effect within a specified time. I wonder if any students have similar anti-attack solutions?

我想大聲告訴你
我想大聲告訴你

reply all(2)
我想大聲告訴你

You can consider using an upstream, setting a weight, and transferring 90% of requests to a dummy interface

伊謝爾倫

fine, make up for it yourself

nginx+lua=openresty

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template