Skip to content

Instantly share code, notes, and snippets.

@nicloay
Forked from supairish/gist:2951524
Last active August 29, 2015 13:57
Show Gist options
  • Save nicloay/9466391 to your computer and use it in GitHub Desktop.
Save nicloay/9466391 to your computer and use it in GitHub Desktop.
http://habrahabr.ru/post/215233/ protect nginx from google DDOS + http://habrahabr.ru/post/215543/ (wordpress DDOS)
http {
map $http_user_agent $limit_bots {
default '';
~*(google|bing|yandex|msnbot|wordpress) $binary_remote_addr;
}
limit_req_zone $limit_bots zone=bots:10m rate=1r/m;
server {
location / {
limit_req zone=bots burst=5 nodelay;
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment