Skip to content

Commit

Permalink
Merge pull request #148 from HSLdevcom/linjasto2021
Browse files Browse the repository at this point in the history
Linjasto2021
  • Loading branch information
optionsome authored Feb 19, 2021
2 parents a4800e7 + f9d49df commit bf1b7e9
Show file tree
Hide file tree
Showing 4 changed files with 90 additions and 52 deletions.
34 changes: 34 additions & 0 deletions common.conf
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,20 @@ location /map/v1/next- {
# add_header X-Cache-Status $upstream_cache_status;
}

location /map/v1/linjasto2021- {
rewrite /map/v1/linjasto2021-(.*) /map/v1/$1 break;
proxy_pass http://hsl-map-server-linjasto2021: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/ {
proxy_pass http://hsl-map-server:8080;
proxy_cache tiles;
Expand Down Expand Up @@ -268,6 +282,16 @@ location /routing/v1/routers/next-waltti {
proxy_read_timeout 11500ms;
}

location /routing/v1/routers/linjasto2021-waltti {
rewrite /routing/v1/routers/linjasto2021-waltti(.*) /otp/routers/default$1 break;
proxy_pass http://opentripplanner-linjasto2021-waltti: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-data/v2/hsl {
rewrite /routing-data/v2/hsl/(.*) /$1 break;
proxy_pass http://opentripplanner-data-con-hsl:8080/;
Expand Down Expand Up @@ -318,6 +342,16 @@ location /routing-data/v2/next-waltti {
include cors.conf;
}

location /routing-data/v2/linjasto2021-waltti {
rewrite /routing-data/v2/linjasto2021-waltti/(.*) /$1 break;
proxy_pass http://opentripplanner-data-con-linjasto2021-waltti: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/v2/next-finland {
rewrite /routing-data/v2/next-finland/(.*) /$1 break;
proxy_pass http://opentripplanner-data-con-finland:8080/;
Expand Down
3 changes: 2 additions & 1 deletion nginx.conf
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,8 @@ http {
dev-tampere.digitransit.fi tampere.digitransit.fi pilottirepa.tampere.fi repa.tampere.fi reittiopas.tampere.fi
dev-kouvola.digitransit.fi kouvola.digitransit.fi
dev-rovaniemi.digitransit.fi rovaniemi.digitransit.fi
dev-opas.waltti.fi opas.waltti.fi;
dev-opas.waltti.fi opas.waltti.fi
dev-linjasto2021.digitransit.fi linjasto2021.digitransit.fi;
listen 8080;

if ($http_x_forwarded_proto != "https") {
Expand Down
102 changes: 51 additions & 51 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions test.js
Original file line number Diff line number Diff line change
Expand Up @@ -235,6 +235,9 @@ describe('waltti ui', function() {
testRedirect('next-dev-opas.waltti.fi','/kissa','https://next-dev-opas.waltti.fi/kissa');
testProxying('next-dev-opas.waltti.fi','/','digitransit-ui-waltti-next:8080', true);

testRedirect('linjasto2021.digitransit.fi','/kissa','https://linjasto2021.digitransit.fi/kissa');
testProxying('linjasto2021.digitransit.fi','/','digitransit-ui-waltti:8080', true);

it('https should not redirect', function(done) {
httpsGet('turku.digitransit.fi','/kissa').end((err,res)=>{
expect(err).to.be.null;
Expand Down

0 comments on commit bf1b7e9

Please sign in to comment.