]> git.openstreetmap.org Git - chef.git/blobdiff - cookbooks/tile/templates/default/apache.erb
Block scrapers on render servers instead of restricting to caches
[chef.git] / cookbooks / tile / templates / default / apache.erb
index 9199cb3a9e64412174f3b22fbf9e36ef3c60ce82..292744195021b201dc0481d5d64833a262d05090 100644 (file)
 <% end -%>
 
   # Setup logging
-  CustomLog /var/log/apache2/access.log combined
+  LogFormat "%a %l %u %t \"%r\" %>s %O \"%{Referer}i\" \"%{User-Agent}i\"" combined_with_remoteip
+  CustomLog /var/log/apache2/access.log combined_with_remoteip
   ErrorLog /var/log/apache2/error.log
   BufferedLogs on
 
+  # Always set Access-Control-Allow-Origin so that simple CORS requests
+  # will always work and can be cached
+  Header set Access-Control-Allow-Origin "*"
+
+  # Remove Proxy request header to mitigate https://httpoxy.org/
+  RequestHeader unset Proxy early
+
   # Enable the rewrite engine
   RewriteEngine on
 
 <Directory /srv/tile.openstreetmap.org/html>
   Options None
   AllowOverride None
-  Order allow,deny
-  Allow from all
+  Require all granted
 </Directory>
 
 <Directory /srv/tile.openstreetmap.org/cgi-bin>
   Options ExecCGI
   AllowOverride None
-  Order allow,deny
-  Allow from all
+  Require all granted
 </Directory>
+
+<Location /cgi-bin/export>
+  <RequireAll>
+    Require all granted
+    Require not ip 60.199.131.39
+    Require not ip 92.217.67.26
+    Require not ip 103.53.208.109
+    Require not ip 113.196.123.178
+    Require not ip 118.193.51.194
+    Require not ip 119.188.70.34
+    Require not ip 165.228.125.15
+    Require not ip 171.13.14.152
+    Require not ip 171.15.132.56
+    Require not ip 199.203.108.5
+    Require not ip 210.209.89.127
+    Require not ip 210.65.88.6
+  </RequireAll>
+</Location>