X-Git-Url: https://git.openstreetmap.org./chef.git/blobdiff_plain/6f15d6819fb0db20b81081c00abcde93c0923177..85b1552114bd1cecf242caffcd4015500675bf9e:/cookbooks/tile/templates/default/apache.erb diff --git a/cookbooks/tile/templates/default/apache.erb b/cookbooks/tile/templates/default/apache.erb index a34f2b5d1..f7cba541b 100644 --- a/cookbooks/tile/templates/default/apache.erb +++ b/cookbooks/tile/templates/default/apache.erb @@ -47,6 +47,11 @@ # Enable the rewrite engine RewriteEngine on + # Enforce rate limits + RewriteMap ipmap txt:/srv/tile.openstreetmap.org/conf/ip.map + RewriteCond ${ipmap:%{REMOTE_ADDR}} ^.+$ + RewriteRule ^.*$ /${ipmap:%{REMOTE_ADDR}} [PT] + # Rewrite tile requests to the default style RewriteRule ^/(\d+)/(\d+)/(\d+)\.png$ /default/$1/$2/$3.png [PT,T=image/png,L] RewriteRule ^/(\d+)/(\d+)/(\d+)\.png/status/?$ /default/$1/$2/$3.png/status [PT,T=text/plain,L] @@ -59,6 +64,12 @@ # Redirect ACME certificate challenges RedirectPermanent /.well-known/acme-challenge/ http://acme.openstreetmap.org/.well-known/acme-challenge/ + + # Internal endpoint for blocked users + + Header always set Cache-Control private + Redirect 429 +