Skip to content

Commit

Permalink
Merge pull request #46 from HSLdevcom/DT-2181
Browse files Browse the repository at this point in the history
DT-2181
  • Loading branch information
vesameskanen authored Sep 7, 2017
2 parents 426c0a3 + 802a645 commit 2989888
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 4 deletions.
20 changes: 20 additions & 0 deletions nginx.conf
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,26 @@ http {
}
}

server {
server_name next-dev.digitransit.fi;
listen 8080;

if ($http_x_forwarded_proto != "https") {
return 301 https://$host$request_uri;
}

# Add HTTP Strict Transport Security for good measure.
add_header Strict-Transport-Security "max-age=31536000; includeSubDomains;";

location / {
proxy_pass http://digitransit-ui-hsl-next: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;
}
}

server {
server_name digitransit.fi www.digitransit.fi dev-site.digitransit.fi;
listen 8080;
Expand Down
14 changes: 10 additions & 4 deletions test/test.js
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,11 @@ describe('hsl ui', function() {

testProxying('beta.reittiopas.fi','/','digitransit-ui-hsl:8080', true);
testProxying('dev.reittiopas.fi','/','digitransit-ui-hsl:8080', true);

//next-dev site
testRedirect('www.next-dev.digitransit.fi','/kissa','http://next-dev.digitransit.fi/kissa');
testRedirect('next-dev.digitransit.fi','/kissa','https://next-dev.digitransit.fi/kissa');
testProxying('next-dev.digitransit.fi','/','digitransit-ui-hsl-next:8080', true);
});

describe('matka ui', function() {
Expand Down Expand Up @@ -184,8 +189,9 @@ describe('digitransit', function() {
});

describe('ext-proxy', function() {
testCaching('api.digitransit.fi','/out/helsinki-fi.smoove.pro/api-public/stations',false);
testCaching('api.digitransit.fi','/out/p.hsl.fi/api/v1/facilities.json?limit=-1',false);
testCaching('api.digitransit.fi','/out/92.62.36.215/RTIX/trip-updates',false);
testCaching('api.digitransit.fi','/out/beta.liikennevirasto.fi/joukkoliikenne/manual_gtfsrt/api/gtfsrt/alerts',false);
this.timeout(5000);
testCaching('api.digitransit.fi','/out/helsinki-fi.smoove.pro/api-public/stations',false);
testCaching('api.digitransit.fi','/out/p.hsl.fi/api/v1/facilities.json?limit=-1',false);
testCaching('api.digitransit.fi','/out/92.62.36.215/RTIX/trip-updates',false);
testCaching('api.digitransit.fi','/out/beta.liikennevirasto.fi/joukkoliikenne/manual_gtfsrt/api/gtfsrt/alerts',false);
});

0 comments on commit 2989888

Please sign in to comment.