Skip to content

Commit

Permalink
Merge pull request #257 from HSLdevcom/DT-6317
Browse files Browse the repository at this point in the history
Use data server instead of con for data endpoint
  • Loading branch information
vesameskanen authored Aug 29, 2024
2 parents f1bcc2a + e42abe6 commit 4e19e76
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 19 deletions.
20 changes: 5 additions & 15 deletions common.conf
Original file line number Diff line number Diff line change
Expand Up @@ -368,7 +368,7 @@ location /routing-data/v2/finland {

location /routing-data/v3/hsl {
rewrite /routing-data/v3/hsl/(.*) /$1 break;
proxy_pass http://opentripplanner-data-con-hsl-v3:8080/;
proxy_pass http://opentripplanner-data-server-hsl-v3:8080/;
proxy_redirect off;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
Expand All @@ -378,7 +378,7 @@ location /routing-data/v3/hsl {

location /routing-data/v3/waltti {
rewrite /routing-data/v3/waltti/(.*) /$1 break;
proxy_pass http://opentripplanner-data-con-waltti-v3:8080/;
proxy_pass http://opentripplanner-data-server-waltti-v3:8080/;
proxy_redirect off;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
Expand All @@ -388,17 +388,7 @@ location /routing-data/v3/waltti {

location /routing-data/v3/varely {
rewrite /routing-data/v3/varely/(.*) /$1 break;
proxy_pass http://opentripplanner-data-con-varely-v3: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;
include cors.conf;
}

location /routing-data/v3/kela {
rewrite /routing-data/v3/kela/(.*) /$1 break;
proxy_pass http://opentripplanner-data-con-kela-v3:8080/;
proxy_pass http://opentripplanner-data-server-varely-v3:8080/;
proxy_redirect off;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
Expand All @@ -408,7 +398,7 @@ location /routing-data/v3/kela {

location /routing-data/v3/waltti-alt {
rewrite /routing-data/v3/waltti-alt/(.*) /$1 break;
proxy_pass http://opentripplanner-data-con-waltti-alt-v3:8080/;
proxy_pass http://opentripplanner-data-server-waltti-alt-v3:8080/;
proxy_redirect off;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
Expand All @@ -418,7 +408,7 @@ location /routing-data/v3/waltti-alt {

location /routing-data/v3/finland {
rewrite /routing-data/v3/finland/(.*) /$1 break;
proxy_pass http://opentripplanner-data-con-finland-v3:8080/;
proxy_pass http://opentripplanner-data-server-finland-v3:8080/;
proxy_redirect off;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
Expand Down
8 changes: 4 additions & 4 deletions test.js
Original file line number Diff line number Diff line change
Expand Up @@ -174,13 +174,13 @@ describe('api.digitransit.fi', function() {
testResponseHeader('api.digitransit.fi','/routing-data/v2/waltti/router-config.json', 'access-control-allow-origin', '*');
testProxying('api.digitransit.fi','/routing-data/v2/finland/router-finland.zip','opentripplanner-data-con-finland:8080');
testResponseHeader('api.digitransit.fi','/routing-data/v2/finland/router-config.json', 'access-control-allow-origin', '*');
testProxying('dev-api.digitransit.fi','/routing-data/v3/hsl/router-hsl.zip','opentripplanner-data-con-hsl-v3:8080');
testProxying('dev-api.digitransit.fi','/routing-data/v3/hsl/router-hsl.zip','opentripplanner-data-server-hsl-v3:8080');
testResponseHeader('dev-api.digitransit.fi','/routing-data/v3/hsl/router-config.json', 'access-control-allow-origin', '*');
testProxying('dev-api.digitransit.fi','/routing-data/v3/waltti/router-waltti.zip','opentripplanner-data-con-waltti-v3:8080');
testProxying('dev-api.digitransit.fi','/routing-data/v3/waltti/router-waltti.zip','opentripplanner-data-server-waltti-v3:8080');
testResponseHeader('dev-api.digitransit.fi','/routing-data/v3/waltti/router-config.json', 'access-control-allow-origin', '*');
testProxying('dev-api.digitransit.fi','/routing-data/v3/waltti-alt/router-waltti.zip','opentripplanner-data-con-waltti-alt-v3:8080');
testProxying('dev-api.digitransit.fi','/routing-data/v3/waltti-alt/router-waltti.zip','opentripplanner-data-server-waltti-alt-v3:8080');
testResponseHeader('dev-api.digitransit.fi','/routing-data/v3/waltti-alt/router-config.json', 'access-control-allow-origin', '*');
testProxying('dev-api.digitransit.fi','/routing-data/v3/finland/router-finland.zip','opentripplanner-data-con-finland-v3:8080');
testProxying('dev-api.digitransit.fi','/routing-data/v3/finland/router-finland.zip','opentripplanner-data-server-finland-v3:8080');
testResponseHeader('dev-api.digitransit.fi','/routing-data/v3/finland/router-config.json', 'access-control-allow-origin', '*');
testProxying('api.digitransit.fi','/ui/v3/matka/sw.js','digitransit-ui-matka-v3:8080');
testProxying('api.digitransit.fi','/ui/v3/hsl/sw.js','digitransit-ui-hsl-v3:8080');
Expand Down

0 comments on commit 4e19e76

Please sign in to comment.