From 3657e3a5e094a34d661f9605fe83051332a1d5dd Mon Sep 17 00:00:00 2001 From: Vesa Meskanen Date: Fri, 1 Oct 2021 12:29:50 +0300 Subject: [PATCH] Revert "Temporarily disable map api" This reverts commit 99ed076739aa7fe43ab30fcf8016fc67dd1c5801. --- common.conf | 23 +++++++++++++++++++++-- test.js | 4 ++-- 2 files changed, 23 insertions(+), 4 deletions(-) diff --git a/common.conf b/common.conf index 0975b7c..68d5334 100644 --- a/common.conf +++ b/common.conf @@ -133,11 +133,30 @@ location /realtime/raildigitraffic2gtfsrt/v1/ { } location /map/v1/next- { - return 500; + rewrite /map/v1/next-(.*) /map/v1/$1 break; + proxy_pass http://hsl-map-server-next:8080; + # proxy_cache tiles; + # proxy_cache_use_stale error timeout http_500 http_502 http_503 http_504; + # proxy_cache_revalidate on; + # proxy_cache_lock on; + proxy_redirect off; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + # proxy_set_header X-Forwarded-Host $host; + # add_header X-Cache-Status $upstream_cache_status; } location /map/v1/ { - return 500; + proxy_pass http://hsl-map-server:8080; + proxy_cache tiles; + proxy_cache_use_stale error timeout http_500 http_502 http_503 http_504; + proxy_cache_revalidate on; + proxy_cache_lock on; + proxy_redirect off; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + # proxy_set_header X-Forwarded-Host $host; + add_header X-Cache-Status $upstream_cache_status; } location /graphiql/ { diff --git a/test.js b/test.js index 43c590d..ff30689 100644 --- a/test.js +++ b/test.js @@ -118,8 +118,8 @@ describe('api.digitransit.fi', function() { // testCaching('api.digitransit.fi','/realtime/vehicle-positions/v1/foo',false); testProxying('api.digitransit.fi','/realtime/raildigitraffic2gtfsrt/v1/','raildigitraffic2gtfsrt:8080'); //testCaching('api.digitransit.fi','/realtime/raildigitraffic2gtfsrt/v1/foo',true); - // testProxying('api.digitransit.fi','/map/v1/','hsl-map-server:8080'); - // testProxying('api.digitransit.fi','/map/v1/next-hsl-map/index.json','hsl-map-server-next:8080'); + testProxying('api.digitransit.fi','/map/v1/','hsl-map-server:8080'); + testProxying('api.digitransit.fi','/map/v1/next-hsl-map/index.json','hsl-map-server-next:8080'); testProxying('api.digitransit.fi','/routing/v1/routers/finland','opentripplanner-finland:8080'); testProxying('api.digitransit.fi','/routing/v1/routers/hsl','opentripplanner-hsl:8080'); testProxying('api.digitransit.fi','/routing/v1/routers/waltti','opentripplanner-waltti:8080');