Skip to content

Commit

Permalink
Merge pull request #175 from HSLdevcom/rovaniemi-ui-update
Browse files Browse the repository at this point in the history
Rovaniemi UI update
  • Loading branch information
vesameskanen authored Oct 26, 2021
2 parents 0dc2077 + 5417053 commit eaf3995
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 50 deletions.
37 changes: 1 addition & 36 deletions nginx.conf
Original file line number Diff line number Diff line change
Expand Up @@ -159,41 +159,6 @@ http {
return 301 https://dev.digitransit.fi;
}

server {
server_name dev-rovaniemi.digitransit.fi rovaniemi.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 = /sw.js {
proxy_pass http://digitransit-ui-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_cache sw;
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 / {
proxy_pass http://digitransit-ui-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;
}
}

server {
server_name dev-linjasto2021.digitransit.fi linjasto2021.digitransit.fi;
listen 8080;
Expand All @@ -216,7 +181,7 @@ http {
next-dev-turku.digitransit.fi dev-turku.digitransit.fi turku.digitransit.fi reittiopas.foli.fi
next-dev-tampere.digitransit.fi dev-tampere.digitransit.fi tampere.digitransit.fi repa.tampere.fi reittiopas.tampere.fi
next-dev-kouvola.digitransit.fi dev-kouvola.digitransit.fi kouvola.digitransit.fi
next-dev-rovaniemi.digitransit.fi
next-dev-rovaniemi.digitransit.fi dev-rovaniemi.digitransit.fi rovaniemi.digitransit.fi
next-dev-opas.waltti.fi dev-opas.waltti.fi opas.waltti.fi
next-dev-vaasa.digitransit.fi dev-vaasa.digitransit.fi vaasa.digitransit.fi;
listen 8080;
Expand Down
17 changes: 3 additions & 14 deletions test.js
Original file line number Diff line number Diff line change
Expand Up @@ -199,23 +199,12 @@ describe('matka ui', function() {
});

describe('waltti ui', function() {
const legacyUICities = ['rovaniemi'];

const newUICities = [
const walttiCities = [
'jyvaskyla', 'kuopio', 'mikkeli', 'turku', 'tampere', 'vaasa', 'hameenlinna',
'joensuu', 'kotka', 'lahti', 'lappeenranta', 'kouvola','oulu'
'joensuu', 'kotka', 'lahti', 'lappeenranta', 'kouvola','oulu', 'rovaniemi'
];

legacyUICities.forEach(function(city) {
testRedirect('dev-'+city+'.digitransit.fi','/kissa','https://dev-'+city+'.digitransit.fi/kissa');
testProxying('dev-'+city+'.digitransit.fi','/','digitransit-ui-waltti:8080', true);
testRedirect('next-dev-'+city+'.digitransit.fi','/kissa','https://next-dev-'+city+'.digitransit.fi/kissa');
testProxying('next-dev-'+city+'.digitransit.fi','/','digitransit-ui-waltti-next:8080', true);
testRedirect(city+'.digitransit.fi','/kissa','https://'+city+'.digitransit.fi/kissa');
testProxying(city+'.digitransit.fi','/','digitransit-ui-waltti:8080', true);
});

newUICities.forEach(function(city) {
walttiCities.forEach(function(city) {
testRedirect('dev-'+city+'.digitransit.fi','/kissa','https://dev-'+city+'.digitransit.fi/kissa');
testProxying('dev-'+city+'.digitransit.fi','/','digitransit-ui-waltti-next:8080', true);
testRedirect('next-dev-'+city+'.digitransit.fi','/kissa','https://next-dev-'+city+'.digitransit.fi/kissa');
Expand Down

0 comments on commit eaf3995

Please sign in to comment.