Skip to content

Commit

Permalink
Merge pull request #184 from HSLdevcom/apim-test-ui-upd
Browse files Browse the repository at this point in the history
Use own ui deployment for apim test
  • Loading branch information
Antiik91 authored Feb 11, 2022
2 parents dcead54 + aef0b34 commit 1da0807
Show file tree
Hide file tree
Showing 2 changed files with 49 additions and 4 deletions.
48 changes: 47 additions & 1 deletion nginx.conf
Original file line number Diff line number Diff line change
Expand Up @@ -308,7 +308,7 @@ http {
}

server {
server_name dev.reittiopas.fi reittiopas.hsl.fi apim-test-hsl.digitransit.fi;
server_name dev.reittiopas.fi reittiopas.hsl.fi;
listen 8080;

if ($http_x_forwarded_proto != "https") {
Expand Down Expand Up @@ -402,6 +402,52 @@ http {
}
}

server {
server_name apim-test-hsl.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;";

error_page 500 502 503 504 /502.html;
location = /502.html {
proxy_pass https://errorpages.blob.core.windows.net/html/error_page.html;
internal;
}

location = /sw.js {
proxy_pass http://digitransit-ui-apim-test:8080;
include basicsettings.conf;
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 /local-storage-emitter {
proxy_hide_header X-Frame-Options;
proxy_pass http://digitransit-ui-apim-test:8080;
include basicsettings.conf;
}
location = /haku {
proxy_hide_header X-Frame-Options;
proxy_pass http://digitransit-ui-apim-test:8080;
include basicsettings.conf;
}

location / {
proxy_pass http://digitransit-ui-apim-test:8080;
include basicsettings.conf;
}
}

server {
server_name sentry-analytics.digitransit.fi;
listen 8080;
Expand Down
5 changes: 2 additions & 3 deletions test.js
Original file line number Diff line number Diff line change
Expand Up @@ -178,9 +178,8 @@ describe('hsl ui', function() {

testRedirect('reittiopas.hsl.fi','/','https://hsl.fi/?fromJourneyPlanner=true', true);
testProxying('reittiopas.hsl.fi','/kissa','digitransit-ui-hsl-v2:8080', true);

testRedirect('apim-test-hsl.digitransit.fi','/','https://hsl.fi/?fromJourneyPlanner=true', true);
testProxying('apim-test-hsl.digitransit.fi','/kissa','digitransit-ui-hsl-v2:8080', true);
;
testProxying('apim-test-hsl.digitransit.fi','/kissa','digitransit-ui-apim-test:8080', true);

testCaching('reittiopas.hsl.fi','/sw.js', true);

Expand Down

0 comments on commit 1da0807

Please sign in to comment.