]> git.openstreetmap.org Git - chef.git/blobdiff - cookbooks/nominatim/templates/default/nginx.erb
Revert "Disable OAuth 1.0a and basic authentication"
[chef.git] / cookbooks / nominatim / templates / default / nginx.erb
index 4f171bf06958e71427b9edcc508fc4a70a188b46..5e74bef73cd975cc114c25cbc3fe95bacc1e62ac 100644 (file)
@@ -188,13 +188,16 @@ server {
     }
 
     location @php {
     }
 
     location @php {
+        if ($forward_to_ui) {
+            rewrite ^(/[^/]*) https://$host/ui$1.html redirect;
+        }
         if ($blocked_user_agent ~ ^2$)
         { return 403; }
         if ($blocked_referrer)
         { return 403; }
         if ($blocked_email)
         { return 403; }
         if ($blocked_user_agent ~ ^2$)
         { return 403; }
         if ($blocked_referrer)
         { return 403; }
         if ($blocked_email)
         { return 403; }
-        if ($arg_q ~* "^[0-9]+\.[0-9]+\.[0-9]+\.[0-9]+$")
+        if ($args ~* "q=[0-9]+\.[0-9]+\.[0-9]+\.[0-9]+[ &]")
         { return 418; }
         include <%= @confdir %>/nginx_blocked_generic.conf;
 
         { return 418; }
         include <%= @confdir %>/nginx_blocked_generic.conf;
 
@@ -225,9 +228,6 @@ server {
         proxy_redirect off;
         proxy_pass http://nominatim_service;
 <% end -%>
         proxy_redirect off;
         proxy_pass http://nominatim_service;
 <% end -%>
-        if ($forward_to_ui) {
-            rewrite ^(/[^/]*) https://$host/ui$1.html redirect;
-        }
     }
 
 <% if node[:nominatim][:api_flavour] == "php" %>
     }
 
 <% if node[:nominatim][:api_flavour] == "php" %>