Skip to content

Instantly share code, notes, and snippets.

@DeviaVir
Created September 6, 2015 11:23
Show Gist options
  • Save DeviaVir/ab0ff1675229fd722d3f to your computer and use it in GitHub Desktop.
Save DeviaVir/ab0ff1675229fd722d3f to your computer and use it in GitHub Desktop.
# block specific user agents used for evil
if ($http_user_agent ~* "Purebot|Lipperhey|MaMa CaSpEr|libwww-perl|Mail.Ru|gold crawler|morfeus fucking scanner|ZmEu") {
return 403;
}
# Secure WP-login a bit better
set $blockemptyuseragent C;
if ($http_user_agent = '') {
set $blockemptyuseragent A;
}
location = /wp-login.php {
if ($blockemptyuseragent = A) {
return 403;
}
limit_req zone=one burst=1 nodelay;
server_tokens off;
proxy_pass http://http_vi_cluster;
}
@DeviaVir
Copy link
Author

DeviaVir commented Sep 6, 2015

in server {} block

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment