web-dev-qa-db-ja.com

Nginx limit_req_zoneip例外

私が使う:

http {
        limit_req_zone  $binary_remote_addr  zone=one:10m   rate=5r/s;
}
server {
    location ~ \.php$ {
            limit_req   zone=one  burst=2 nodelay; 
            try_files $uri $uri/ /index.php;
            root   /var/www/;
            fastcgi_pass   127.0.0.1:9001;
            fastcgi_index  index.php;
            fastcgi_param  SCRIPT_FILENAME  $document_root$fastcgi_script_name;
            include        fastcgi_params;
    }
}

IPの制限を無効にするにはどうすればよいですか:127.0.0.1および99.99.99.99?

5
Tony
geo $limited_ip {
    default      1;
    127.0.0.1    0;
    99.99.99.99  0;
}

map $limited_ip $limited_ip_key {
    0 '';
    1 $binary_remote_addr;
}

limit_req_zone $limited_ip_key zone=one:10m rate=5r/s;;
6
VBart