diff --git a/common.conf b/common.conf index e0e275e..cd60e5e 100644 --- a/common.conf +++ b/common.conf @@ -228,6 +228,33 @@ location /map/v3/kela/en/ { proxy_set_header Accept-Language "en"; } +location /map/v3-kela/kela/fi/ { + rewrite /map/v3-kela/kela/fi/(.*) /otp/routers/kela/vectorTiles/$1 break; + proxy_pass http://opentripplanner-kela-v2:8080; + 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 Accept-Language "fi"; +} + +location /map/v3-kela/kela/sv/ { + rewrite /map/v3-kela/kela/sv/(.*) /otp/routers/kela/vectorTiles/$1 break; + proxy_pass http://opentripplanner-kela-v2:8080; + 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 Accept-Language "sv"; +} + +location /map/v3-kela/kela/en/ { + rewrite /map/v3-kela/kela/en/(.*) /otp/routers/kela/vectorTiles/$1 break; + proxy_pass http://opentripplanner-kela-v2:8080; + 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 Accept-Language "en"; +} + location /graphiql/ { proxy_pass http://graphiql:8080; proxy_redirect off; @@ -326,6 +353,16 @@ location /routing/v2/routers/kela { proxy_read_timeout 11500ms; } +location /routing/v2-kela/routers/kela { + rewrite /routing/v2-kela/(.*) /otp/$1 break; + proxy_pass http://opentripplanner-kela-v2:8080/; + 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; + proxy_read_timeout 11500ms; +} + location /routing/v2/routers/hsl { rewrite /routing/v2/(.*) /otp/$1 break; proxy_pass http://opentripplanner-hsl-v2:8080/; diff --git a/test.js b/test.js index 368206a..04bce1e 100644 --- a/test.js +++ b/test.js @@ -124,6 +124,7 @@ describe('api.digitransit.fi', function() { testProxying('api.digitransit.fi','/map/v3/finland/en/rental-stations/','opentripplanner-finland-v2:8080'); testProxying('api.digitransit.fi','/map/v3/varely/en/stops,stations/','opentripplanner-varely-v2:8080'); testProxying('api.digitransit.fi','/map/v3/waltti-alt/en/rental-stations/','opentripplanner-waltti-alt-v2:8080'); + testProxying('api.digitransit.fi','/map/v3-kela/kela/en/rental-stations/','opentripplanner-kela-v2: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'); @@ -131,6 +132,7 @@ describe('api.digitransit.fi', function() { testProxying('dev-api.digitransit.fi','/routing/v2/routers/hsl','opentripplanner-hsl-v2:8080'); testProxying('dev-api.digitransit.fi','/routing/v2/routers/waltti','opentripplanner-waltti-v2:8080'); testProxying('dev-api.digitransit.fi','/routing/v2/routers/waltti-alt','opentripplanner-waltti-alt-v2:8080'); + testProxying('dev-api.digitransit.fi','/routing/v2-kela/routers/kela','opentripplanner-kela-v2:8080'); testProxying('api.digitransit.fi','/routing-data/v2/hsl/router-hsl.zip','opentripplanner-data-con-hsl:8080'); testResponseHeader('api.digitransit.fi','/routing-data/v2/hsl/router-config.json', 'access-control-allow-origin', '*'); testProxying('api.digitransit.fi','/routing-data/v2/waltti/router-waltti.zip','opentripplanner-data-con-waltti:8080');