From d2c83d07d878fbe74e30c0f964933868046e86db Mon Sep 17 00:00:00 2001 From: Tom Hughes Date: Mon, 20 Apr 2009 21:14:39 +0000 Subject: [PATCH] Pull in block rules from the lighttpd config. --- config/nginx.conf | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) 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; -- 2.43.2