From 07f6693a4eeaa65502d78f0c40ce3e07929dc9af Mon Sep 17 00:00:00 2001 From: Grant Slater Date: Wed, 13 May 2026 14:38:47 +0100 Subject: [PATCH] vector: Redirect vector.osm.org to not require CORs --- cookbooks/vectortile/templates/default/nginx.erb | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/cookbooks/vectortile/templates/default/nginx.erb b/cookbooks/vectortile/templates/default/nginx.erb index 30e6cd616..938dfe2de 100644 --- a/cookbooks/vectortile/templates/default/nginx.erb +++ b/cookbooks/vectortile/templates/default/nginx.erb @@ -52,6 +52,10 @@ server { add_header x-rendered-by "<%= node.name %>" always; } location /demo/ { + # Redirect to the canonical hostname else CORs will prevent the demo from working + if ($host != "vector.openstreetmap.org") { + return 301 https://vector.openstreetmap.org$request_uri; + } proxy_pass http://demo; proxy_http_version 1.1; proxy_set_header Connection ""; -- 2.47.3