From 3418883e2b44d3aa2994c705da50f0b62cd1fd89 Mon Sep 17 00:00:00 2001 From: Antiik91 Date: Wed, 23 Oct 2019 11:51:56 +0300 Subject: [PATCH 01/12] removed caches from map, realtime and geocoding --- common.conf | 102 ++++++++++++++++++++++++++-------------------------- test.js | 8 ++--- 2 files changed, 55 insertions(+), 55 deletions(-) diff --git a/common.conf b/common.conf index 43e7200..3c8cc9e 100644 --- a/common.conf +++ b/common.conf @@ -1,10 +1,10 @@ location /geocoding/v1/ { rewrite /geocoding/v1/(.*) /v1/$1 break; proxy_pass http://pelias-api:8080/; - proxy_cache geocoding; - proxy_cache_valid 3d; - proxy_cache_use_stale error timeout http_500 http_502 http_503 http_504; - add_header X-Proxy-Cache $upstream_cache_status; + # proxy_cache geocoding; + # proxy_cache_valid 3d; + # proxy_cache_use_stale error timeout http_500 http_502 http_503 http_504; + # add_header X-Proxy-Cache $upstream_cache_status; proxy_redirect off; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; @@ -19,13 +19,13 @@ location /realtime/trip-updates/v1/ { 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_cache common; - proxy_cache_valid 200 30s; - proxy_cache_lock on; - proxy_cache_key "$host$request_uri"; - add_header X-Proxy-Cache $upstream_cache_status; - proxy_ignore_headers X-Accel-Expires Expires Cache-Control Set-Cookie; - proxy_cache_use_stale error timeout http_500 http_502 http_503 http_504; + # proxy_cache common; + # proxy_cache_valid 200 30s; + # proxy_cache_lock on; + # proxy_cache_key "$host$request_uri"; + # add_header X-Proxy-Cache $upstream_cache_status; + # proxy_ignore_headers X-Accel-Expires Expires Cache-Control Set-Cookie; + # proxy_cache_use_stale error timeout http_500 http_502 http_503 http_504; } # used to be "alias" for hslalert, now same as v2 @@ -35,13 +35,13 @@ location /realtime/service-alerts/v1/ { 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_cache common; - proxy_cache_valid 200 30s; - proxy_cache_lock on; - proxy_cache_key "$host$request_uri"; - add_header X-Proxy-Cache $upstream_cache_status; - proxy_ignore_headers X-Accel-Expires Expires Cache-Control Set-Cookie; - proxy_cache_use_stale error timeout http_500 http_502 http_503 http_504; + # proxy_cache common; + # proxy_cache_valid 200 30s; + # proxy_cache_lock on; + # proxy_cache_key "$host$request_uri"; + # add_header X-Proxy-Cache $upstream_cache_status; + # proxy_ignore_headers X-Accel-Expires Expires Cache-Control Set-Cookie; + # proxy_cache_use_stale error timeout http_500 http_502 http_503 http_504; } location /realtime/service-alerts/v2/hsl { @@ -50,13 +50,13 @@ location /realtime/service-alerts/v2/hsl { 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_cache common; - proxy_cache_valid 200 30s; - proxy_cache_lock on; - proxy_cache_key "$host$request_uri"; - add_header X-Proxy-Cache $upstream_cache_status; - proxy_ignore_headers X-Accel-Expires Expires Cache-Control Set-Cookie; - proxy_cache_use_stale error timeout http_500 http_502 http_503 http_504; + # proxy_cache common; + # proxy_cache_valid 200 30s; + # proxy_cache_lock on; + # proxy_cache_key "$host$request_uri"; + # add_header X-Proxy-Cache $upstream_cache_status; + # proxy_ignore_headers X-Accel-Expires Expires Cache-Control Set-Cookie; + # proxy_cache_use_stale error timeout http_500 http_502 http_503 http_504; } location /realtime/trip-updates/v2/hsl { @@ -65,13 +65,13 @@ location /realtime/trip-updates/v2/hsl { 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_cache common; - proxy_cache_valid 200 30s; - proxy_cache_lock on; - proxy_cache_key "$host$request_uri"; - add_header X-Proxy-Cache $upstream_cache_status; - proxy_ignore_headers X-Accel-Expires Expires Cache-Control Set-Cookie; - proxy_cache_use_stale error timeout http_500 http_502 http_503 http_504; + # proxy_cache common; + # proxy_cache_valid 200 30s; + # proxy_cache_lock on; + # proxy_cache_key "$host$request_uri"; + # add_header X-Proxy-Cache $upstream_cache_status; + # proxy_ignore_headers X-Accel-Expires Expires Cache-Control Set-Cookie; + # proxy_cache_use_stale error timeout http_500 http_502 http_503 http_504; } location /realtime/vehicle-positions/v2/hsl { @@ -90,13 +90,13 @@ location /realtime/vehicle-positions/v1/ { 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_cache common; - proxy_cache_valid 200 30s; - proxy_cache_lock on; - proxy_cache_key "$host$request_uri"; - add_header X-Proxy-Cache $upstream_cache_status; - proxy_ignore_headers X-Accel-Expires Expires Cache-Control Set-Cookie; - proxy_cache_use_stale error timeout http_500 http_502 http_503 http_504; + # proxy_cache common; + # proxy_cache_valid 200 30s; + # proxy_cache_lock on; + # proxy_cache_key "$host$request_uri"; + # add_header X-Proxy-Cache $upstream_cache_status; + # proxy_ignore_headers X-Accel-Expires Expires Cache-Control Set-Cookie; + # proxy_cache_use_stale error timeout http_500 http_502 http_503 http_504; } location /realtime/raildigitraffic2gtfsrt/v1/ { @@ -107,26 +107,26 @@ location /realtime/raildigitraffic2gtfsrt/v1/ { proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header X-Forwarded-Host $host; include cors.conf; - proxy_cache common; - proxy_cache_valid 200 30s; - proxy_cache_lock on; - proxy_cache_key "$host$request_uri"; - add_header X-Proxy-Cache $upstream_cache_status; - proxy_ignore_headers X-Accel-Expires Expires Cache-Control Set-Cookie; - proxy_cache_use_stale error timeout http_500 http_502 http_503 http_504; + # proxy_cache common; + # proxy_cache_valid 200 30s; + # proxy_cache_lock on; + # proxy_cache_key "$host$request_uri"; + # add_header X-Proxy-Cache $upstream_cache_status; + # proxy_ignore_headers X-Accel-Expires Expires Cache-Control Set-Cookie; + # proxy_cache_use_stale error timeout http_500 http_502 http_503 http_504; } location /map/v1/ { 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_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; + # add_header X-Cache-Status $upstream_cache_status; } location /graphiql/ { diff --git a/test.js b/test.js index d4b8056..5464a73 100644 --- a/test.js +++ b/test.js @@ -110,14 +110,14 @@ describe('api.digitransit.fi', function() { }); testProxying('api.digitransit.fi','/geocoding/v1/','pelias-api:8080'); - testCaching('api.digitransit.fi','/geocoding/v1/foo', true); + //testCaching('api.digitransit.fi','/geocoding/v1/foo', true); testProxying('api.digitransit.fi','/graphiql/hsl','graphiql:8080'); testProxying('api.digitransit.fi','/realtime/trip-updates/v1/','siri2gtfsrt:8080'); - testCaching('api.digitransit.fi','/realtime/trip-updates/v1/foo', false) + //testCaching('api.digitransit.fi','/realtime/trip-updates/v1/foo', false) testProxying('api.digitransit.fi','/realtime/vehicle-positions/v1/','navigator-server:8080'); - testCaching('api.digitransit.fi','/realtime/vehicle-positions/v1/foo',false); + // 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); + //testCaching('api.digitransit.fi','/realtime/raildigitraffic2gtfsrt/v1/foo',true); testProxying('api.digitransit.fi','/map/v1/','hsl-map-server:8080'); testProxying('api.digitransit.fi','/routing/v1/routers/finland','opentripplanner-finland:8080'); testProxying('api.digitransit.fi','/routing/v1/routers/hsl','opentripplanner-hsl:8080'); From e1ca08685b0e71b109e9ebd3c3ba0cb98c4e53ed Mon Sep 17 00:00:00 2001 From: Antiik91 Date: Wed, 23 Oct 2019 13:13:21 +0300 Subject: [PATCH 02/12] Travis build for this branch --- .travis.yml | 10 ++++++---- travis-build.sh | 13 +++++++++---- 2 files changed, 15 insertions(+), 8 deletions(-) diff --git a/.travis.yml b/.travis.yml index 36a22c9..d46ac11 100644 --- a/.travis.yml +++ b/.travis.yml @@ -3,12 +3,14 @@ branches: only: - master - /20(1[7-9]|2[0-9])[0-1][0-9][0-3][0-9]/ + - remove-caches services: docker -install: - - npm install - language: node_js -script: ./travis-build.sh +node_js: '10' + +install: true + +script: yarn install && ./travis-build.sh \ No newline at end of file diff --git a/travis-build.sh b/travis-build.sh index ac8181c..6ceaa5c 100755 --- a/travis-build.sh +++ b/travis-build.sh @@ -22,12 +22,17 @@ if [ "${TRAVIS_PULL_REQUEST}" == "false" ]; then docker tag ${DOCKER_IMAGE} ${PROD_IMAGE} docker push ${PROD_IMAGE} else - echo "processing master build $TRAVIS_COMMIT" ./test.sh docker build --tag=$DOCKER_IMAGE -f Dockerfile . docker push ${DOCKER_IMAGE} - docker tag ${DOCKER_IMAGE} ${LATEST_IMAGE} - docker push ${LATEST_IMAGE} + echo "processing $TRAVIS_BRANCH build $TRAVIS_COMMIT" + if [ "$TRAVIS_BRANCH" = "master" ]; then + docker tag ${DOCKER_IMAGE} ${LATEST_IMAGE} + docker push ${LATEST_IMAGE} + else + docker tag ${DOCKER_IMAGE} $ORG/digitransit-proxy:$TRAVIS_BRANCH + docker push $ORG/digitransit-proxy:$TRAVIS_BRANCH + fi fi else echo "processing pr $TRAVIS_PULL_REQUEST" @@ -35,4 +40,4 @@ else docker build --tag=$DOCKER_IMAGE -f Dockerfile . fi -echo Build completed +echo Build completed \ No newline at end of file From 76efd20516015f2c390ee1e63d20a6a930784c18 Mon Sep 17 00:00:00 2001 From: Antiik91 Date: Wed, 23 Oct 2019 15:00:55 +0300 Subject: [PATCH 03/12] removed geocache and tiles cache --- nginx.conf | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/nginx.conf b/nginx.conf index 2e27593..fb68c96 100644 --- a/nginx.conf +++ b/nginx.conf @@ -33,8 +33,8 @@ http { application/atom+xml; proxy_temp_path /opt/nginx/temp-cache; - proxy_cache_path /opt/nginx/cache levels=1:2 keys_zone=tiles:10m max_size=4g inactive=7d use_temp_path=off; - proxy_cache_path /opt/nginx/geocache levels=1:2 keys_zone=geocoding:10m max_size=4g inactive=7d use_temp_path=off; + # proxy_cache_path /opt/nginx/cache levels=1:2 keys_zone=tiles:10m max_size=4g inactive=7d use_temp_path=off; + # proxy_cache_path /opt/nginx/geocache levels=1:2 keys_zone=geocoding:10m max_size=4g inactive=7d use_temp_path=off; proxy_cache_path /opt/nginx/external-cache levels=1:2 keys_zone=ext_cache:10m max_size=1g inactive=60m use_temp_path=off; proxy_cache_path /opt/nginx/common levels=1:2 keys_zone=common:10m max_size=4g inactive=60m use_temp_path=off; proxy_cache_path /opt/nginx/sw levels=1:2 keys_zone=sw:10m max_size=200m inactive=1m use_temp_path=off; From 5991b51f6265bdc5ed60094d0438318abf7c31b9 Mon Sep 17 00:00:00 2001 From: Joel Lappalainen Date: Tue, 19 Nov 2019 15:39:29 +0200 Subject: [PATCH 04/12] Add new api location for trip updates for google use --- common.conf | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/common.conf b/common.conf index 3c8cc9e..a1daa29 100644 --- a/common.conf +++ b/common.conf @@ -74,6 +74,21 @@ location /realtime/trip-updates/v2/hsl { # proxy_cache_use_stale error timeout http_500 http_502 http_503 http_504; } +location /realtime/trip-updates-for-google/v2/hsl { + proxy_pass https://transitdatadev.blob.core.windows.net/trip-updates-for-google/v2/hsl; + 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_cache common; + proxy_cache_valid 200 30s; + proxy_cache_lock on; + proxy_cache_key "$host$request_uri"; + add_header X-Proxy-Cache $upstream_cache_status; + proxy_ignore_headers X-Accel-Expires Expires Cache-Control Set-Cookie; + proxy_cache_use_stale error timeout http_500 http_502 http_503 http_504; +} + location /realtime/vehicle-positions/v2/hsl { proxy_pass https://transitdatadev.blob.core.windows.net/vehicle-positions/v2/hsl; proxy_redirect off; From 78e0abedc078159295600ccd8eb2376d0941d258 Mon Sep 17 00:00:00 2001 From: Joel Lappalainen Date: Thu, 10 Oct 2019 21:56:16 +0300 Subject: [PATCH 05/12] Use custom timeouts everywhere and reduce default read timeout to 10s --- nginx.conf | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/nginx.conf b/nginx.conf index fb68c96..8bfdd34 100644 --- a/nginx.conf +++ b/nginx.conf @@ -17,6 +17,10 @@ http { sendfile on; + proxy_connect_timeout 10s; + proxy_send_timeout 10s; + proxy_read_timeout 10s; + gzip on; gzip_http_version 1.0; gzip_proxied any; @@ -56,9 +60,6 @@ http { ""; listen 8080; - proxy_connect_timeout 10s; - proxy_send_timeout 10s; - proxy_read_timeout 20s; include common.conf; include external.conf; From 9cce622a626e4a4c2d4e3ae8a1d28310ec99efc5 Mon Sep 17 00:00:00 2001 From: Joel Lappalainen Date: Thu, 10 Oct 2019 22:11:13 +0300 Subject: [PATCH 06/12] Set custom read timeouts for routing and geocoding --- common.conf | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/common.conf b/common.conf index a1daa29..da0ad87 100644 --- a/common.conf +++ b/common.conf @@ -9,6 +9,7 @@ location /geocoding/v1/ { 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 9s; } #"alias" for siri2gtfsrt @@ -159,6 +160,7 @@ location /routing/v1/routers/finland { 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 29500ms; } # Disable profile routing from Finland @@ -173,6 +175,7 @@ location /routing/v1/routers/hsl { 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/v1/routers/waltti { @@ -182,6 +185,7 @@ location /routing/v1/routers/waltti { 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; } # Disable profile routing from Waltti @@ -196,6 +200,7 @@ location /routing/v1/routers/next-finland { 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 29500ms; } location /routing/v1/routers/next-hsl { @@ -205,6 +210,7 @@ location /routing/v1/routers/next-hsl { 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/v1/routers/next-waltti { @@ -214,6 +220,7 @@ location /routing/v1/routers/next-waltti { 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-data/v2/hsl { From 490a2d73d20baf2ba752d98ced0d32fbe4fcf8dd Mon Sep 17 00:00:00 2001 From: Joel Lappalainen Date: Tue, 10 Dec 2019 14:08:56 +0200 Subject: [PATCH 07/12] Don't cache --- common.conf | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/common.conf b/common.conf index da0ad87..c6f67c1 100644 --- a/common.conf +++ b/common.conf @@ -81,13 +81,13 @@ location /realtime/trip-updates-for-google/v2/hsl { 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_cache common; - proxy_cache_valid 200 30s; - proxy_cache_lock on; - proxy_cache_key "$host$request_uri"; - add_header X-Proxy-Cache $upstream_cache_status; - proxy_ignore_headers X-Accel-Expires Expires Cache-Control Set-Cookie; - proxy_cache_use_stale error timeout http_500 http_502 http_503 http_504; + # proxy_cache common; + # proxy_cache_valid 200 30s; + # proxy_cache_lock on; + # proxy_cache_key "$host$request_uri"; + # add_header X-Proxy-Cache $upstream_cache_status; + # proxy_ignore_headers X-Accel-Expires Expires Cache-Control Set-Cookie; + # proxy_cache_use_stale error timeout http_500 http_502 http_503 http_504; } location /realtime/vehicle-positions/v2/hsl { From b78513ac237b1bc3bc3d29ffd064c309f52959c8 Mon Sep 17 00:00:00 2001 From: Joel Lappalainen Date: Tue, 10 Dec 2019 14:38:36 +0200 Subject: [PATCH 08/12] Re-enable map cache --- common.conf | 10 +++++----- nginx.conf | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/common.conf b/common.conf index c6f67c1..5da0b6d 100644 --- a/common.conf +++ b/common.conf @@ -134,15 +134,15 @@ location /realtime/raildigitraffic2gtfsrt/v1/ { location /map/v1/ { 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_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; + add_header X-Cache-Status $upstream_cache_status; } location /graphiql/ { diff --git a/nginx.conf b/nginx.conf index 8bfdd34..ed31471 100644 --- a/nginx.conf +++ b/nginx.conf @@ -37,7 +37,7 @@ http { application/atom+xml; proxy_temp_path /opt/nginx/temp-cache; - # proxy_cache_path /opt/nginx/cache levels=1:2 keys_zone=tiles:10m max_size=4g inactive=7d use_temp_path=off; + proxy_cache_path /opt/nginx/cache levels=1:2 keys_zone=tiles:10m max_size=4g inactive=7d use_temp_path=off; # proxy_cache_path /opt/nginx/geocache levels=1:2 keys_zone=geocoding:10m max_size=4g inactive=7d use_temp_path=off; proxy_cache_path /opt/nginx/external-cache levels=1:2 keys_zone=ext_cache:10m max_size=1g inactive=60m use_temp_path=off; proxy_cache_path /opt/nginx/common levels=1:2 keys_zone=common:10m max_size=4g inactive=60m use_temp_path=off; From ed91098b9064003dd387b2f0e9958c6a0179745f Mon Sep 17 00:00:00 2001 From: Joel Lappalainen Date: Fri, 13 Dec 2019 16:42:27 +0200 Subject: [PATCH 09/12] Add X-Forwarded-Host in API management instead of proxy --- common.conf | 58 ++++++++++++++++++++++++++--------------------------- 1 file changed, 29 insertions(+), 29 deletions(-) diff --git a/common.conf b/common.conf index 5da0b6d..f45fef2 100644 --- a/common.conf +++ b/common.conf @@ -8,7 +8,7 @@ location /geocoding/v1/ { 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_set_header X-Forwarded-Host $host; proxy_read_timeout 9s; } @@ -19,7 +19,7 @@ location /realtime/trip-updates/v1/ { 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_set_header X-Forwarded-Host $host; # proxy_cache common; # proxy_cache_valid 200 30s; # proxy_cache_lock on; @@ -35,7 +35,7 @@ location /realtime/service-alerts/v1/ { 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_set_header X-Forwarded-Host $host; # proxy_cache common; # proxy_cache_valid 200 30s; # proxy_cache_lock on; @@ -50,7 +50,7 @@ location /realtime/service-alerts/v2/hsl { 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_set_header X-Forwarded-Host $host; # proxy_cache common; # proxy_cache_valid 200 30s; # proxy_cache_lock on; @@ -65,7 +65,7 @@ location /realtime/trip-updates/v2/hsl { 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_set_header X-Forwarded-Host $host; # proxy_cache common; # proxy_cache_valid 200 30s; # proxy_cache_lock on; @@ -80,7 +80,7 @@ location /realtime/trip-updates-for-google/v2/hsl { 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_set_header X-Forwarded-Host $host; # proxy_cache common; # proxy_cache_valid 200 30s; # proxy_cache_lock on; @@ -95,7 +95,7 @@ location /realtime/vehicle-positions/v2/hsl { 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_set_header X-Forwarded-Host $host; } #"alias" for navigator-server @@ -105,7 +105,7 @@ location /realtime/vehicle-positions/v1/ { 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_set_header X-Forwarded-Host $host; # proxy_cache common; # proxy_cache_valid 200 30s; # proxy_cache_lock on; @@ -121,7 +121,7 @@ location /realtime/raildigitraffic2gtfsrt/v1/ { 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_set_header X-Forwarded-Host $host; include cors.conf; # proxy_cache common; # proxy_cache_valid 200 30s; @@ -141,7 +141,7 @@ location /map/v1/ { 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_set_header X-Forwarded-Host $host; add_header X-Cache-Status $upstream_cache_status; } @@ -150,7 +150,7 @@ location /graphiql/ { 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_set_header X-Forwarded-Host $host; } location /routing/v1/routers/finland { @@ -159,7 +159,7 @@ location /routing/v1/routers/finland { 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_set_header X-Forwarded-Host $host; proxy_read_timeout 29500ms; } @@ -174,7 +174,7 @@ location /routing/v1/routers/hsl { 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_set_header X-Forwarded-Host $host; proxy_read_timeout 11500ms; } @@ -184,7 +184,7 @@ location /routing/v1/routers/waltti { 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_set_header X-Forwarded-Host $host; proxy_read_timeout 11500ms; } @@ -199,7 +199,7 @@ location /routing/v1/routers/next-finland { 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_set_header X-Forwarded-Host $host; proxy_read_timeout 29500ms; } @@ -209,7 +209,7 @@ location /routing/v1/routers/next-hsl { 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_set_header X-Forwarded-Host $host; proxy_read_timeout 11500ms; } @@ -219,7 +219,7 @@ location /routing/v1/routers/next-waltti { 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_set_header X-Forwarded-Host $host; proxy_read_timeout 11500ms; } @@ -229,7 +229,7 @@ location /routing-data/v2/hsl { 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_set_header X-Forwarded-Host $host; include cors.conf; } @@ -239,7 +239,7 @@ location /routing-data/v2/waltti { 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_set_header X-Forwarded-Host $host; include cors.conf; } @@ -249,7 +249,7 @@ location /routing-data/v2/finland { 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_set_header X-Forwarded-Host $host; include cors.conf; } @@ -259,7 +259,7 @@ location /routing-data/v2/next-hsl { 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_set_header X-Forwarded-Host $host; include cors.conf; } @@ -269,7 +269,7 @@ location /routing-data/v2/next-waltti { 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_set_header X-Forwarded-Host $host; include cors.conf; } @@ -279,7 +279,7 @@ location /routing-data/v2/next-finland { 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_set_header X-Forwarded-Host $host; include cors.conf; } @@ -289,7 +289,7 @@ location /ui/v1/finland/ { 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_set_header X-Forwarded-Host $host; } location /ui/v1/waltti/ { @@ -298,7 +298,7 @@ location /ui/v1/waltti/ { 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_set_header X-Forwarded-Host $host; } location /ui/v1/hsl/ { @@ -307,7 +307,7 @@ location /ui/v1/hsl/ { 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_set_header X-Forwarded-Host $host; } location /ui/v1/hsl-next/ { @@ -316,7 +316,7 @@ location /ui/v1/hsl-next/ { 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_set_header X-Forwarded-Host $host; } location /timetables/v1/hsl/ { @@ -325,7 +325,7 @@ location /timetables/v1/hsl/ { 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_set_header X-Forwarded-Host $host; } location /fonts/ { @@ -334,7 +334,7 @@ location /fonts/ { 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_set_header X-Forwarded-Host $host; add_header 'Access-Control-Allow-Methods' 'GET, POST, OPTIONS'; add_header 'Access-Control-Allow-Headers' 'DNT,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type,Range'; } From bc1095711a535fa44c1e52a16edf4b83905c4008 Mon Sep 17 00:00:00 2001 From: Joonas Rissanen Date: Tue, 17 Dec 2019 10:34:51 +0200 Subject: [PATCH 10/12] fix breaking tests --- test.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test.js b/test.js index 5464a73..edd0092 100644 --- a/test.js +++ b/test.js @@ -40,7 +40,7 @@ function testProxying(host, path, proxyTo, secure) { const verify = (err,res) => { expect(err).to.be.null; verifyHost(proxyTo, res); - verifyForwardedHost(host, res); + // verifyForwardedHost(host, res); done(); }; let fn = secure?httpsGet:get; From 4a814d916c003125138fa43491efd392269d021c Mon Sep 17 00:00:00 2001 From: Joel Lappalainen Date: Tue, 17 Dec 2019 12:04:48 +0200 Subject: [PATCH 11/12] Add couple of new hsl vp endpoints --- common.conf | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/common.conf b/common.conf index f45fef2..f8da1bd 100644 --- a/common.conf +++ b/common.conf @@ -98,6 +98,22 @@ location /realtime/vehicle-positions/v2/hsl { # proxy_set_header X-Forwarded-Host $host; } +location /realtime/vehicle-positions-bustram/v2/hsl { + proxy_pass https://transitdatadev.blob.core.windows.net/vehicle-positions-bustram/v2/hsl; + 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; +} + +location /realtime/vehicle-positions-trainmetro/v2/hsl { + proxy_pass https://transitdatadev.blob.core.windows.net/vehicle-positions-trainmetro/v2/hsl; + 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; +} + #"alias" for navigator-server location /realtime/vehicle-positions/v1/ { rewrite /realtime/vehicle-positions/v1/(.*) /$1 break; From 80cc1fb419ffeebf679053e367058fdea6e8182c Mon Sep 17 00:00:00 2001 From: Joel Lappalainen Date: Tue, 7 Jan 2020 16:12:24 +0200 Subject: [PATCH 12/12] Clean travis file --- .travis.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index d46ac11..c50357d 100644 --- a/.travis.yml +++ b/.travis.yml @@ -3,7 +3,6 @@ branches: only: - master - /20(1[7-9]|2[0-9])[0-1][0-9][0-3][0-9]/ - - remove-caches services: docker