From: Tom Hughes Date: Mon, 20 Apr 2009 21:14:39 +0000 (+0000) Subject: Pull in block rules from the lighttpd config. X-Git-Tag: live~7574 X-Git-Url: https://git.openstreetmap.org/rails.git/commitdiff_plain/d2c83d07d878fbe74e30c0f964933868046e86db?ds=sidebyside Pull in block rules from the lighttpd config. --- diff --git a/config/nginx.conf b/config/nginx.conf index 3fdf72f1a..1108be5dc 100644 --- a/config/nginx.conf +++ b/config/nginx.conf @@ -136,8 +136,19 @@ http { } # Placeholder for blocking abuse + include /etc/nginx/blocked_hosts; allow all; - + + # Block some bulk download agents + if ($http_user_agent ~* LWP::Simple|downloadosm|BBBike) { + return 403; + } + + # Block some robots + if ($http_user_agent ~* msnbot|twiceler) { + return 403; + } + # Map api.openstreetmap/0.n/... to api.openstreetmap/api/0.n/... if ($host ~* ^api\.) { rewrite ^/(0\.[0-9]+)/(.*)$ /api/$1/$2;