]> git.openstreetmap.org Git - rails.git/commitdiff
Pull in block rules from the lighttpd config.
authorTom Hughes <tom@compton.nu>
Mon, 20 Apr 2009 21:14:39 +0000 (21:14 +0000)
committerTom Hughes <tom@compton.nu>
Mon, 20 Apr 2009 21:14:39 +0000 (21:14 +0000)
config/nginx.conf

index 3fdf72f1a9afb300ff3463d40bf1fbe2459242ab..1108be5dc4b9b295183b3c235ab719d0011f5d7f 100644 (file)
@@ -136,8 +136,19 @@ http {
         }
 
         # Placeholder for blocking abuse
         }
 
         # Placeholder for blocking abuse
+        include /etc/nginx/blocked_hosts;
         allow all; 
         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;
         # Map api.openstreetmap/0.n/... to api.openstreetmap/api/0.n/...
         if ($host ~* ^api\.) {
             rewrite ^/(0\.[0-9]+)/(.*)$ /api/$1/$2;