Skip to content

Instantly share code, notes, and snippets.

@arosenhagen
Forked from supairish/gist:2951524
Last active February 16, 2021 11:34
Show Gist options
  • Select an option

  • Save arosenhagen/8aaf5d7f94171778c0e9 to your computer and use it in GitHub Desktop.

Select an option

Save arosenhagen/8aaf5d7f94171778c0e9 to your computer and use it in GitHub Desktop.

Revisions

  1. arosenhagen revised this gist Dec 21, 2014. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion gistfile1.txt
    Original file line number Diff line number Diff line change
    @@ -2,7 +2,7 @@

    map $http_user_agent $limit_bots {
    default '';
    ~*(google|bing|yandex|msnbot) $binary_remote_addr;
    ~*(bing|yandex|msnbot) $binary_remote_addr;
    }

    limit_req_zone $limit_bots zone=bots:10m rate=1r/m;
  2. arosenhagen revised this gist Dec 21, 2014. No changes.
  3. @supairish supairish created this gist Jun 18, 2012.
    15 changes: 15 additions & 0 deletions gistfile1.txt
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,15 @@
    http {

    map $http_user_agent $limit_bots {
    default '';
    ~*(google|bing|yandex|msnbot) $binary_remote_addr;
    }

    limit_req_zone $limit_bots zone=bots:10m rate=1r/m;

    server {
    location / {
    limit_req zone=bots burst=5 nodelay;
    }
    }
    }