From 9b934731bf732630fe4cad132688fac56d3b1d18 Mon Sep 17 00:00:00 2001 From: Jason Thomas Date: Thu, 6 Jun 2024 22:27:38 +0100 Subject: [PATCH 1/2] redirect old links --- ui/container-files/etc/nginx/conf.d/default.conf | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/ui/container-files/etc/nginx/conf.d/default.conf b/ui/container-files/etc/nginx/conf.d/default.conf index d354825bc..2aa55167f 100644 --- a/ui/container-files/etc/nginx/conf.d/default.conf +++ b/ui/container-files/etc/nginx/conf.d/default.conf @@ -51,5 +51,15 @@ server { location ~ ^/(cs|en|es|fr|it|ja|ko|pt|ru|zh-CN|zh-TW)/(.*)$ { try_files $uri $uri/ /$1/index.html?$args; } + + # Redirect Old Links {https://trello.com/c/fciDxx5n/999-l08-redirect-old-links} + rewrite ^/member$ /en/members; + rewrite ^/member/(.*)$ /en/members/$1; + + rewrite ^/user$ /en/users; + rewrite ^/user/(.*)$ /en/users/$1; + + rewrite ^/assertion$ /en/; + rewrite ^/assertion/(.*)$ /en/$1; } } From 48949d17d8370c54d9dfcd02e8c100e86f64d221 Mon Sep 17 00:00:00 2001 From: Jason Thomas Date: Fri, 7 Jun 2024 17:12:01 +0100 Subject: [PATCH 2/2] use less rewrite rules --- ui/container-files/etc/nginx/conf.d/default.conf | 16 ++++------------ 1 file changed, 4 insertions(+), 12 deletions(-) diff --git a/ui/container-files/etc/nginx/conf.d/default.conf b/ui/container-files/etc/nginx/conf.d/default.conf index 2aa55167f..a91d86fc7 100644 --- a/ui/container-files/etc/nginx/conf.d/default.conf +++ b/ui/container-files/etc/nginx/conf.d/default.conf @@ -33,8 +33,10 @@ server { expires off; etag off; - # The load balancer is Temporarily configured to forward all requests for '^/ui(.*)' to this docker container running nginx listening on port 8090. - # The context path for this app will eventully be changed to the root dir '/' and the Gateway App will be decomissioned and all rewrites and location blocks will need to be re-assessed and updated. + # Redirect Old Links + rewrite ^/member(.*)$ /en/members$1; + rewrite ^/user(.*)$ /en/users$1; + rewrite ^/assertion(.*)$ /en$1; # Temporary Rule, when the UI app is served from the root instead of `/ui` then this rewrite rule can be removed. rewrite ^/ui/(.*)$ /$1 last; @@ -51,15 +53,5 @@ server { location ~ ^/(cs|en|es|fr|it|ja|ko|pt|ru|zh-CN|zh-TW)/(.*)$ { try_files $uri $uri/ /$1/index.html?$args; } - - # Redirect Old Links {https://trello.com/c/fciDxx5n/999-l08-redirect-old-links} - rewrite ^/member$ /en/members; - rewrite ^/member/(.*)$ /en/members/$1; - - rewrite ^/user$ /en/users; - rewrite ^/user/(.*)$ /en/users/$1; - - rewrite ^/assertion$ /en/; - rewrite ^/assertion/(.*)$ /en/$1; } }