]> git.openstreetmap.org Git - chef.git/commitdiff
nominatim: refuse to geocode IP addresses
authorSarah Hoffmann <lonvia@denofr.de>
Wed, 27 Mar 2024 10:32:23 +0000 (11:32 +0100)
committerSarah Hoffmann <lonvia@denofr.de>
Wed, 27 Mar 2024 13:13:49 +0000 (14:13 +0100)
cookbooks/nominatim/templates/default/nginx.erb

index 6aa07dbe139a61293d4503ae107f443761bc19b5..e15099c057a3de9ed2ed79cd7c9353fc9202742a 100644 (file)
@@ -201,6 +201,8 @@ server {
         { return 403; }
         if ($blocked_path)
         { return 403; }
         { return 403; }
         if ($blocked_path)
         { return 403; }
+        if ($args ~* "q=[0-9]+\.[0-9]+\.[0-9]+\.[0-9]+[ &]")
+        { return 418; }
         include <%= @confdir %>/nginx_blocked_generic.conf;
 
         limit_req zone=www burst=10;
         include <%= @confdir %>/nginx_blocked_generic.conf;
 
         limit_req zone=www burst=10;