Skip to content

Commit

Permalink
nominatim: filter for browser faking scripts
Browse files Browse the repository at this point in the history
  • Loading branch information
lonvia committed Jun 14, 2024
1 parent 1874a3b commit d971a54
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion cookbooks/nominatim/templates/default/nginx.erb
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit d971a54

Please sign in to comment.