]> git.openstreetmap.org Git - chef.git/commitdiff
nominatim: filter for browser faking scripts
authorSarah Hoffmann <lonvia@denofr.de>
Fri, 14 Jun 2024 18:35:36 +0000 (20:35 +0200)
committerSarah Hoffmann <lonvia@denofr.de>
Fri, 14 Jun 2024 18:35:36 +0000 (20:35 +0200)
cookbooks/nominatim/templates/default/nginx.erb

index 5e74bef73cd975cc114c25cbc3fe95bacc1e62ac..ddebe7c0b70fdb1a32e00e23c6edc2a38d2b766a 100644 (file)
@@ -69,7 +69,12 @@ geo $whitelisted {
     2620:52:3:1:5054:ff:fe0a:75aa 1; # gnome
 }
 
-map $missing_email$missing_referer$http_user_agent $blocked_user_agent {
+map $server_protocol$http_user_agent $cleaned_user_agent {
+    default $http_user_agent;
+    "~^HTTP/1..Mozilla/" Script$http_user_agent;
+}
+
+map $missing_email$missing_referer$cleaned_user_agent $blocked_user_agent {
    default 0;
    "11" 2; # block any requests without identifier
    include <%= @confdir %>/nginx_blocked_user_agent.conf;