nginxddos攻击

编程

  1. limit_req_zone $binary_remote_addr zone=one:

    10m rate=

    1r/s;

  2. limit_req zone=one burst=

    5;

     

    #user  nobody;

    worker_processes 2;

    events {

    worker_connections 1024;

    }

    http {

    keepalive_timeout 65;

    limit_req_zone $binary_remote_addr zone=one:100m rate=30r/m;

    include /usr/local/nginx/conf/mime.types;

    default_type application/octet-stream;

    upstream back{

    # ip_hash;

    server localhost:9002;

    }

    upstream front{

    # ip_hash;

    server localhost:8080;

    }

    server {

    listen 9000;

    location ^~ /quick/front {

    alias /opt/quick/front;

    index index.html;

    }

    # 反向代理

    location / {

    proxy_pass http://localhost:9002/quick/back/;

    }

    }

    server {

    listen 9999;

    # 反向代理

    location / {

    limit_req zone=one burst=10 nodelay;

    proxy_pass https://www.baidu.com;

    }

    }

    }

以上是 nginxddos攻击 的全部内容, 来源链接: utcz.com/z/517013.html

回到顶部