Skip to content

Commit

Permalink
Merge pull request #249 from HSLdevcom/fix-external
Browse files Browse the repository at this point in the history
Move external to be in default_server
  • Loading branch information
vesameskanen authored Mar 15, 2024
2 parents 3645a9e + fd4c780 commit f1abb8d
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 10 deletions.
2 changes: 1 addition & 1 deletion nginx.conf
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ http {

server {
listen 8080 default_server;
include external.conf;

# Health check
location = / {
Expand All @@ -82,7 +83,6 @@ http {

listen 8080;
include common.conf;
include external.conf;

# Health check
location / {
Expand Down
21 changes: 12 additions & 9 deletions test.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,13 @@ const assert = chai.assert;
chai.use(chaiHttp);

function get(host, path) {
return chai.request('http://127.0.0.1:9000')
.get(path)
.redirects(0)
.set('host', host)
const req = chai.request('http://127.0.0.1:9000')
.get(path)
.redirects(0)
if (host) {
req.set('host', host)
}
return req
}

function httpsGet(host, path) {
Expand Down Expand Up @@ -278,9 +281,9 @@ describe('otp debug', function() {

describe('ext-proxy', function() {
this.timeout(5000);
testCaching('api.digitransit.fi','/out/helsinki-fi.smoove.pro/api-public/stations',false);
testCaching('api.digitransit.fi','/out/data.foli.fi/citybike/smoove',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/stables.donkey.bike/api/public/gbfs/2/donkey_lappeenranta/en/station_status.json',false);
testCaching(null,'/out/helsinki-fi.smoove.pro/api-public/stations',false);
testCaching(null,'/out/data.foli.fi/citybike/smoove',false);
testCaching(null,'/out/p.hsl.fi/api/v1/facilities.json?limit=-1',false);
testCaching(null,'/out/92.62.36.215/RTIX/trip-updates',false);
testCaching(null,'/out/stables.donkey.bike/api/public/gbfs/2/donkey_lappeenranta/en/station_status.json',false);
});

0 comments on commit f1abb8d

Please sign in to comment.