Skip to content

Commit

Permalink
Merge pull request #180 from HSLdevcom/ui-updates
Browse files Browse the repository at this point in the history
UI updates
  • Loading branch information
vesameskanen authored Jan 24, 2022
2 parents 429789e + cb34050 commit 88b181b
Show file tree
Hide file tree
Showing 3 changed files with 241 additions and 74 deletions.
62 changes: 49 additions & 13 deletions common.conf
Original file line number Diff line number Diff line change
Expand Up @@ -352,43 +352,79 @@ location /routing-data/v2/next-waltti {

location /ui/v1/finland/ {
rewrite /ui/v1/finland/(.*) /$1 break;
proxy_pass http://digitransit-ui-default:8080;
proxy_pass http://digitransit-ui-matka-v2: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;
}

location /ui/v1/waltti/ {
rewrite /ui/v1/waltti/(.*) /$1 break;
proxy_pass http://digitransit-ui-waltti:8080;
location /ui/v1/hsl-next/ {
rewrite /ui/v1/hsl-next/(.*) /$1 break;
proxy_pass http://digitransit-ui-hsl-v2: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;
}

location /ui/v1/hsl/ {
rewrite /ui/v1/hsl/(.*) /$1 break;
proxy_pass http://digitransit-ui-hsl:8080;
location /ui/v1/waltti-next/ {
rewrite /ui/v1/waltti-next/(.*) /$1 break;
proxy_pass http://digitransit-ui-waltti-v2: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;
}

location /ui/v1/hsl-next/ {
rewrite /ui/v1/hsl-next/(.*) /$1 break;
proxy_pass http://digitransit-ui-hsl-next:8080;
location /ui/v2/matka/ {
rewrite /ui/v2/matka/(.*) /$1 break;
proxy_pass http://digitransit-ui-matka-v2: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;
}

location /ui/v1/waltti-next/ {
rewrite /ui/v1/waltti-next/(.*) /$1 break;
proxy_pass http://digitransit-ui-waltti-next:8080;
location /ui/v2/hsl/ {
rewrite /ui/v2/hsl/(.*) /$1 break;
proxy_pass http://digitransit-ui-hsl-v2: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;
}

location /ui/v2/waltti/ {
rewrite /ui/v2/waltti/(.*) /$1 break;
proxy_pass http://digitransit-ui-waltti-v2: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;
}

location /ui/v3/matka/ {
rewrite /ui/v3/matka/(.*) /$1 break;
proxy_pass http://digitransit-ui-matka-v3: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;
}

location /ui/v3/hsl/ {
rewrite /ui/v3/hsl/(.*) /$1 break;
proxy_pass http://digitransit-ui-hsl-v3: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;
}

location /ui/v3/waltti/ {
rewrite /ui/v3/waltti/(.*) /$1 break;
proxy_pass http://digitransit-ui-waltti-v3:8080;
proxy_redirect off;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
Expand Down
204 changes: 169 additions & 35 deletions nginx.conf
Original file line number Diff line number Diff line change
Expand Up @@ -69,14 +69,7 @@ http {
}

server {
server_name vanha.reittiopas.hsl.fi;
listen 8080;

return 301 https://reittiopas.hsl.fi/etusivu;
}

server {
server_name www.reittiopas.fi m.reittiopas.fi reittiopas.fi uusi.reittiopas.fi uusi.reittiopas.hsl.fi;
server_name www.reittiopas.fi reittiopas.fi;
listen 8080;

# Prevent search engines from indexing the site
Expand Down Expand Up @@ -113,7 +106,46 @@ http {
}

server {
server_name dev.digitransit.fi beta.digitransit.fi opas.matka.fi;
server_name dev.digitransit.fi opas.matka.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/digitransit-error-page.html;
internal;
}

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

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

if ($http_x_forwarded_proto != "https") {
Expand All @@ -130,7 +162,7 @@ http {
}

location = /sw.js {
proxy_pass http://digitransit-ui-default:8080;
proxy_pass http://digitransit-ui-matka-v3:8080;
include basicsettings.conf;
proxy_cache sw;
proxy_cache_valid 200 30s;
Expand All @@ -142,11 +174,11 @@ http {
}
location = /haku {
proxy_hide_header X-Frame-Options;
proxy_pass http://digitransit-ui-default:8080;
proxy_pass http://digitransit-ui-matka-v3:8080;
include basicsettings.conf;
}
location / {
proxy_pass http://digitransit-ui-default:8080;
proxy_pass http://digitransit-ui-matka-v3:8080;
include basicsettings.conf;
}
}
Expand All @@ -168,21 +200,21 @@ http {
}

server {
server_name next-dev-hameenlinna.digitransit.fi dev-hameenlinna.digitransit.fi hameenlinna.digitransit.fi reittiopas.hameenlinna.fi
next-dev-joensuu.digitransit.fi dev-joensuu.digitransit.fi joensuu.digitransit.fi
next-dev-jyvaskyla.digitransit.fi dev-jyvaskyla.digitransit.fi jyvaskyla.digitransit.fi
next-dev-kotka.digitransit.fi dev-kotka.digitransit.fi kotka.digitransit.fi
next-dev-kuopio.digitransit.fi dev-kuopio.digitransit.fi kuopio.digitransit.fi
next-dev-lahti.digitransit.fi dev-lahti.digitransit.fi lahti.digitransit.fi
next-dev-lappeenranta.digitransit.fi dev-lappeenranta.digitransit.fi lappeenranta.digitransit.fi
next-dev-mikkeli.digitransit.fi dev-mikkeli.digitransit.fi mikkeli.digitransit.fi
next-dev-oulu.digitransit.fi dev-oulu.digitransit.fi oulu.digitransit.fi
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 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;
server_name dev-hameenlinna.digitransit.fi hameenlinna.digitransit.fi reittiopas.hameenlinna.fi
dev-joensuu.digitransit.fi joensuu.digitransit.fi
dev-jyvaskyla.digitransit.fi jyvaskyla.digitransit.fi
dev-kotka.digitransit.fi kotka.digitransit.fi
dev-kuopio.digitransit.fi kuopio.digitransit.fi
dev-lahti.digitransit.fi lahti.digitransit.fi
dev-lappeenranta.digitransit.fi lappeenranta.digitransit.fi
dev-mikkeli.digitransit.fi mikkeli.digitransit.fi
dev-oulu.digitransit.fi oulu.digitransit.fi
dev-turku.digitransit.fi turku.digitransit.fi reittiopas.foli.fi
dev-tampere.digitransit.fi tampere.digitransit.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-vaasa.digitransit.fi vaasa.digitransit.fi;
listen 8080;

if ($http_x_forwarded_proto != "https") {
Expand All @@ -199,7 +231,7 @@ http {
}

location = /sw.js {
proxy_pass http://digitransit-ui-waltti-next:8080;
proxy_pass http://digitransit-ui-waltti-v2:8080;
include basicsettings.conf;
proxy_cache sw;
proxy_cache_valid 200 30s;
Expand All @@ -211,17 +243,119 @@ http {
}
location = /haku {
proxy_hide_header X-Frame-Options;
proxy_pass http://digitransit-ui-waltti-next:8080;
proxy_pass http://digitransit-ui-waltti-v2:8080;
include basicsettings.conf;
}
location / {
proxy_pass http://digitransit-ui-waltti-next:8080;
proxy_pass http://digitransit-ui-waltti-v2:8080;
include basicsettings.conf;
}
}

server {
server_name next-dev-hameenlinna.digitransit.fi
next-dev-joensuu.digitransit.fi
next-dev-jyvaskyla.digitransit.fi
next-dev-kotka.digitransit.fi
next-dev-kuopio.digitransit.fi
next-dev-lahti.digitransit.fi
next-dev-lappeenranta.digitransit.fi
next-dev-mikkeli.digitransit.fi
next-dev-oulu.digitransit.fi
next-dev-turku.digitransit.fi
next-dev-tampere.digitransit.fi
next-dev-kouvola.digitransit.fi
next-dev-rovaniemi.digitransit.fi
next-dev-opas.waltti.fi
next-dev-vaasa.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/digitransit-error-page.html;
internal;
}

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

server {
server_name dev.reittiopas.fi reittiopas.hsl.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-hsl-v2: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-hsl-v2:8080;
include basicsettings.conf;
}
location = /haku {
proxy_hide_header X-Frame-Options;
proxy_pass http://digitransit-ui-hsl-v2:8080;
include basicsettings.conf;
}
location = / {
return 301 https://dev.hslfi.hsldev.com/?fromJourneyPlanner=true;
}

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

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

if ($http_x_forwarded_proto != "https") {
Expand All @@ -238,7 +372,7 @@ http {
}

location = /sw.js {
proxy_pass http://digitransit-ui-hsl-next:8080;
proxy_pass http://digitransit-ui-hsl-v3:8080;
include basicsettings.conf;
proxy_cache sw;
proxy_cache_valid 200 30s;
Expand All @@ -251,20 +385,20 @@ http {

location /local-storage-emitter {
proxy_hide_header X-Frame-Options;
proxy_pass http://digitransit-ui-hsl-next:8080;
proxy_pass http://digitransit-ui-hsl-v3:8080;
include basicsettings.conf;
}
location = /haku {
proxy_hide_header X-Frame-Options;
proxy_pass http://digitransit-ui-hsl-next:8080;
proxy_pass http://digitransit-ui-hsl-v3:8080;
include basicsettings.conf;
}
location = / {
return 301 https://dev.hslfi.hsldev.com/?fromJourneyPlanner=true;
}

location / {
proxy_pass http://digitransit-ui-hsl-next:8080;
proxy_pass http://digitransit-ui-hsl-v3:8080;
include basicsettings.conf;
}
}
Expand Down
Loading

0 comments on commit 88b181b

Please sign in to comment.