From 61ba6f810b825a7e456579a60eb9b1a9c7d11a36 Mon Sep 17 00:00:00 2001 From: Grant Slater Date: Mon, 30 Nov 2020 00:03:24 +0000 Subject: [PATCH] tilecache: Deny site service per request of OSMF --- .../tilecache/templates/default/nginx_tile.conf.erb | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/cookbooks/tilecache/templates/default/nginx_tile.conf.erb b/cookbooks/tilecache/templates/default/nginx_tile.conf.erb index 0ea85d755..1dfad9cf4 100644 --- a/cookbooks/tilecache/templates/default/nginx_tile.conf.erb +++ b/cookbooks/tilecache/templates/default/nginx_tile.conf.erb @@ -154,6 +154,14 @@ map $http_referer $denied_referer { '~^https?://[^.]*\.cellmapper\.net/' 1; } +map $http_referer $censored_referer { + default 0; # Not denied + # Legal Reasons + '~^https?://schiebt-sie-ab\.de/' 1; + '~^https?://[^.]*\.schiebt-sie-ab\.de/' 1; +} + + map $http_referer $osm_referer { default ''; # False '~^https:\/\/www\.openstreetmap\.org\/' 'osm'; # True @@ -405,6 +413,11 @@ server { return 418; } + if ($censored_referer) { + set $limit_rate 512; + return 451 "Unavailable For Legal Reasons"; + } + # Strip any ?query parameters from urls set $args ''; -- 2.39.5