Nginx 와 Nginx Plus 를 통 해 DDoS 공격 을 막 습 니 다.

2824 단어
         (DDoS)                                    、                        。                    ,             ,   IDC    、    、         DDoS     ,          DDoS ?  Rick Nelson Nginx             ,       Nginx Nginx Plus  DDoS  。

Rick Nelson     DDoS       ,                 IP  ,   IP                   ;               ,            。  ,        User-Agent        ,Referer                    。      ,Rick Nelson  Nginx Nginx Plus                     DDoS     。

      
 Nginx Nginx Plus                      。  ,                             :

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

server {
    ...
    location /login.html {
        limit_req zone=one;
    ...
    }
}
     ,limit_req_zone         one     zone    $binary_remote_addr     ,location  /login.html limit_req         zone。

        
      IP                     。  ,     IP   /store           10 :

limit_conn_zone $binary_remote_addr zone=addr:10m;

server {
    ...
    location /store/ {
        limit_conn addr 10;
        ...
    }
}
    ,limit_conn_zone         addr     zone     $binary_remote_addr   ,location  /store/ limit_conn         zone,          10.

      
                       ,                  。Slowloris         。  ,    client_body_timeout client_header_timeout                 ,  ,               5s  :

server {
    client_body_timeout 5s;
    client_header_timeout 5s;
    ...
}
  IP    
               IP  ,    deny      , Nginx Nginx Plus              。  ,           123.123.123.3、123.123.123.5 123.123.123.7   :

location / {
    deny 123.123.123.3;
    deny 123.123.123.5;
    deny 123.123.123.7;
    ...
}
  IP    
       IP      ,    allow deny                   IP      IP      。  ,                    IP :

location / {
    allow 192.168.1.0/24;
    deny all;
    ...
}
           
                Nginx Nginx Plus               。  ,  proxy_cache_use_stale   updating    Nginx             ,                     。  ,proxy_cache_key                ,      $scheme$proxy_host$request_uri       ,     $query_string  ,              query_string      ,  ,        ,        $query_string  。

     
  Nginx Nginx Plus         :

     URL      
User-Agent                  
Referer                
                     
  ,          /foo.php      :

location /foo.php {
    deny all;
}
                User-Agent    foo  bar DDoS  :

location / {
    if ($http_user_agent ~* foo|bar) {
        return 403;
    }
    ...
}
             
  Nginx Nginx Plus                   ,      Nginx Plus               。  ,         Nginx Plus                    200 :

upstream website {
    server 192.168.100.1:80 max_conns=200;
    server 192.168.100.2:80 max_conns=200;
    queue 10 timeout=30s;
}
  ,Rick Nelson                          ,      Nginx Plus Status           ,  DDoS  。

          。

좋은 웹페이지 즐겨찾기