From 27f335ae5930a85e3cc18ce4471423d832abba6c Mon Sep 17 00:00:00 2001 From: Joel Lappalainen Date: Mon, 16 Nov 2020 15:16:57 +0200 Subject: [PATCH 1/2] Don't index old URLs for reittiopas --- nginx.conf | 3 +++ 1 file changed, 3 insertions(+) diff --git a/nginx.conf b/nginx.conf index 0144157..e1bbd6f 100644 --- a/nginx.conf +++ b/nginx.conf @@ -107,6 +107,9 @@ http { server_name www.reittiopas.fi m.reittiopas.fi reittiopas.fi uusi.reittiopas.fi uusi.reittiopas.hsl.fi; listen 8080; + # Prevent search engines from indexing the site + add_header X-Robots-Tag "noindex, nofollow, nosnippet, noarchive"; + location = /sw.js { proxy_pass https://serviceworker.blob.core.windows.net/serviceworker/destroy-sw.js; proxy_set_header Host serviceworker.blob.core.windows.net; From c4a0eae17b47f9683744e50981a18e9f42e43911 Mon Sep 17 00:00:00 2001 From: Joel Lappalainen Date: Mon, 16 Nov 2020 15:20:39 +0200 Subject: [PATCH 2/2] Add test --- test.js | 1 + 1 file changed, 1 insertion(+) diff --git a/test.js b/test.js index 1a1c0e6..4c49efa 100644 --- a/test.js +++ b/test.js @@ -149,6 +149,7 @@ describe('hsl ui', function() { testRedirect('reittiopas.fi','/kissa','https://reittiopas.hsl.fi/kissa'); testRedirect('reittiopas.fi','/','https://uusi.hsl.fi/?fromJourneyPlanner=true'); testRedirect('www.reittiopas.fi','/kissa','https://reittiopas.hsl.fi/kissa', true); + testResponseHeader('www.reittiopas.fi','/', 'x-robots-tag', 'noindex, nofollow, nosnippet, noarchive'); testRedirect('m.reittiopas.fi','/kissa','https://reittiopas.hsl.fi/kissa'); testRedirect('dev.reittiopas.fi','/kissa','https://dev.reittiopas.fi/kissa');