From e20f5ac04bf54c501bfff64a759df238cd0a2e20 Mon Sep 17 00:00:00 2001 From: lhr-git <102617425+lhr-git@users.noreply.github.com> Date: Wed, 30 Oct 2024 07:34:08 -0400 Subject: [PATCH] Adding Requested Redirects to New Site (#759) --- gitops/environments/dev/ingresses.yaml | 29 ++++++++++ gitops/environments/production/ingresses.yaml | 56 +++++++++++++++++++ gitops/environments/staging/ingresses.yaml | 28 ++++++++++ gitops/environments/test/ingresses.yaml | 54 ++++++++++++++++++ 4 files changed, 167 insertions(+) diff --git a/gitops/environments/dev/ingresses.yaml b/gitops/environments/dev/ingresses.yaml index 89c533df..5160a871 100644 --- a/gitops/environments/dev/ingresses.yaml +++ b/gitops/environments/dev/ingresses.yaml @@ -1,3 +1,4 @@ +--- apiVersion: networking.k8s.io/v1 kind: Ingress metadata: @@ -5,6 +6,34 @@ metadata: annotations: nginx.ingress.kubernetes.io/proxy-buffer-size: 32k # required for OAuth proxy nginx.ingress.kubernetes.io/ssl-redirect: 'true' + nginx.ingress.kubernetes.io/server-snippet: | + rewrite ^/en/home$ https://www.canada.ca/en/services/retirement.html permanent; + rewrite ^/en/learn$ https://www.canada.ca/en/services/retirement/learn.html permanent; + rewrite ^/en/quiz$ https://www.canada.ca/en/services/retirement/quiz-main.html permanent; + rewrite ^/en/learn/deciding-when-to-start-your-public-pensions$ https://www.canada.ca/en/services/retirement/learn/deciding-when-start-your-public-pensions.html permanent; + rewrite ^/en/learn/rules-of-thumb-for-public-pensions$ https://www.canada.ca/en/services/retirement/learn/rules-thumb-public-pensions.html permanent; + rewrite ^/en/learn/main-sources-of-retirement-income$ https://www.canada.ca/en/services/retirement/learn/main-sources-retirement-income.html permanent; + rewrite ^/en/learn/going-from-work-to-retirement$ https://www.canada.ca/en/services/retirement/learn/going-work-retirement.html permanent; + rewrite ^/en/learn/planning-to-save-for-retirement$ https://www.canada.ca/en/services/retirement/learn/planning-save-retirement.html permanent; + rewrite ^/en/learn/case-studies/bonnie$ https://www.canada.ca/en/services/retirement/learn/case-studies-bonnie.html permanent; + rewrite ^/en/learn/case-studies/fred$ https://www.canada.ca/en/services/retirement/learn/case-studies-fred.html permanent; + rewrite ^/en/learn/case-studies/keith$ https://www.canada.ca/en/services/retirement/learn/case-studies-keith.html permanent; + rewrite ^/en/checklist/$ https://www.canada.ca/en/services/retirement/quiz-main.html permanent; + rewrite ^/fr/home$ https://www.canada.ca/fr/services/retraite.html permanent; + rewrite ^/fr/learn$ https://www.canada.ca/fr/services/retraite/apprendre.html permanent; + rewrite ^/fr/quiz$ https://www.canada.ca/fr/services/retraite/questionnaire-principal.html permanent; + rewrite ^/fr/learn/deciding-when-to-start-your-public-pensions$ https://www.canada.ca/fr/services/retraite/apprendre/decider-quand-recevoir-sa-pension-publique.html permanent; + rewrite ^/fr/learn/rules-of-thumb-for-public-pensions$ https://www.canada.ca/fr/services/retraite/apprendre/regles-generales-pensions-publiques.html permanent; + rewrite ^/fr/learn/main-sources-of-retirement-income$ https://www.canada.ca/fr/services/retraite/apprendre/principales-sources-revenus-retraite.html permanent; + rewrite ^/fr/learn/going-from-work-to-retirement$ https://www.canada.ca/fr/services/retraite/apprendre/transition-travail-retraite.html permanent; + rewrite ^/fr/learn/planning-to-save-for-retirement$ https://www.canada.ca/fr/services/retraite/apprendre/planifier-epargner-retraite.html permanent; + rewrite ^/fr/learn/case-studies/bonnie$ https://www.canada.ca/fr/services/retraite/apprendre/etudes-cas-bonnie.html permanent; + rewrite ^/fr/learn/case-studies/fred$ https://www.canada.ca/fr/services/retraite/apprendre/etudes-cas-fred.html permanent; + rewrite ^/fr/learn/case-studies/keith$ https://www.canada.ca/fr/services/retraite/apprendre/etudes-cas-keith.html permanent; + rewrite ^/fr/checklist/$ https://www.canada.ca/fr/services/retraite/questionnaire-principal.html permanent; + rewrite ^/en$ https://www.canada.ca/en/services/retirement.html permanent; + rewrite ^/fr$ https://www.canada.ca/fr/services/retraite.html permanent; + rewrite ^/$ https://www.canada.ca/fr/services/retraite.html permanent; labels: app.kubernetes.io/name: seniors-journey-frontend spec: diff --git a/gitops/environments/production/ingresses.yaml b/gitops/environments/production/ingresses.yaml index 50d98f03..600d784b 100644 --- a/gitops/environments/production/ingresses.yaml +++ b/gitops/environments/production/ingresses.yaml @@ -4,6 +4,34 @@ metadata: name: internal-seniors-journey-frontend annotations: nginx.ingress.kubernetes.io/ssl-redirect: 'true' + nginx.ingress.kubernetes.io/server-snippet: | + rewrite ^/en/home$ https://www.canada.ca/en/services/retirement.html permanent; + rewrite ^/en/learn$ https://www.canada.ca/en/services/retirement/learn.html permanent; + rewrite ^/en/quiz$ https://www.canada.ca/en/services/retirement/quiz-main.html permanent; + rewrite ^/en/learn/deciding-when-to-start-your-public-pensions$ https://www.canada.ca/en/services/retirement/learn/deciding-when-start-your-public-pensions.html permanent; + rewrite ^/en/learn/rules-of-thumb-for-public-pensions$ https://www.canada.ca/en/services/retirement/learn/rules-thumb-public-pensions.html permanent; + rewrite ^/en/learn/main-sources-of-retirement-income$ https://www.canada.ca/en/services/retirement/learn/main-sources-retirement-income.html permanent; + rewrite ^/en/learn/going-from-work-to-retirement$ https://www.canada.ca/en/services/retirement/learn/going-work-retirement.html permanent; + rewrite ^/en/learn/planning-to-save-for-retirement$ https://www.canada.ca/en/services/retirement/learn/planning-save-retirement.html permanent; + rewrite ^/en/learn/case-studies/bonnie$ https://www.canada.ca/en/services/retirement/learn/case-studies-bonnie.html permanent; + rewrite ^/en/learn/case-studies/fred$ https://www.canada.ca/en/services/retirement/learn/case-studies-fred.html permanent; + rewrite ^/en/learn/case-studies/keith$ https://www.canada.ca/en/services/retirement/learn/case-studies-keith.html permanent; + rewrite ^/en/checklist/$ https://www.canada.ca/en/services/retirement/quiz-main.html permanent; + rewrite ^/fr/home$ https://www.canada.ca/fr/services/retraite.html permanent; + rewrite ^/fr/learn$ https://www.canada.ca/fr/services/retraite/apprendre.html permanent; + rewrite ^/fr/quiz$ https://www.canada.ca/fr/services/retraite/questionnaire-principal.html permanent; + rewrite ^/fr/learn/deciding-when-to-start-your-public-pensions$ https://www.canada.ca/fr/services/retraite/apprendre/decider-quand-recevoir-sa-pension-publique.html permanent; + rewrite ^/fr/learn/rules-of-thumb-for-public-pensions$ https://www.canada.ca/fr/services/retraite/apprendre/regles-generales-pensions-publiques.html permanent; + rewrite ^/fr/learn/main-sources-of-retirement-income$ https://www.canada.ca/fr/services/retraite/apprendre/principales-sources-revenus-retraite.html permanent; + rewrite ^/fr/learn/going-from-work-to-retirement$ https://www.canada.ca/fr/services/retraite/apprendre/transition-travail-retraite.html permanent; + rewrite ^/fr/learn/planning-to-save-for-retirement$ https://www.canada.ca/fr/services/retraite/apprendre/planifier-epargner-retraite.html permanent; + rewrite ^/fr/learn/case-studies/bonnie$ https://www.canada.ca/fr/services/retraite/apprendre/etudes-cas-bonnie.html permanent; + rewrite ^/fr/learn/case-studies/fred$ https://www.canada.ca/fr/services/retraite/apprendre/etudes-cas-fred.html permanent; + rewrite ^/fr/learn/case-studies/keith$ https://www.canada.ca/fr/services/retraite/apprendre/etudes-cas-keith.html permanent; + rewrite ^/fr/checklist/$ https://www.canada.ca/fr/services/retraite/questionnaire-principal.html permanent; + rewrite ^/en$ https://www.canada.ca/en/services/retirement.html permanent; + rewrite ^/fr$ https://www.canada.ca/fr/services/retraite.html permanent; + rewrite ^/$ https://www.canada.ca/fr/services/retraite.html permanent; labels: app.kubernetes.io/name: seniors-journey-frontend spec: @@ -28,6 +56,34 @@ metadata: name: seniors-journey-frontend annotations: nginx.ingress.kubernetes.io/ssl-redirect: 'true' + nginx.ingress.kubernetes.io/server-snippet: | + rewrite ^/en/home$ https://www.canada.ca/en/services/retirement.html permanent; + rewrite ^/en/learn$ https://www.canada.ca/en/services/retirement/learn.html permanent; + rewrite ^/en/quiz$ https://www.canada.ca/en/services/retirement/quiz-main.html permanent; + rewrite ^/en/learn/deciding-when-to-start-your-public-pensions$ https://www.canada.ca/en/services/retirement/learn/deciding-when-start-your-public-pensions.html permanent; + rewrite ^/en/learn/rules-of-thumb-for-public-pensions$ https://www.canada.ca/en/services/retirement/learn/rules-thumb-public-pensions.html permanent; + rewrite ^/en/learn/main-sources-of-retirement-income$ https://www.canada.ca/en/services/retirement/learn/main-sources-retirement-income.html permanent; + rewrite ^/en/learn/going-from-work-to-retirement$ https://www.canada.ca/en/services/retirement/learn/going-work-retirement.html permanent; + rewrite ^/en/learn/planning-to-save-for-retirement$ https://www.canada.ca/en/services/retirement/learn/planning-save-retirement.html permanent; + rewrite ^/en/learn/case-studies/bonnie$ https://www.canada.ca/en/services/retirement/learn/case-studies-bonnie.html permanent; + rewrite ^/en/learn/case-studies/fred$ https://www.canada.ca/en/services/retirement/learn/case-studies-fred.html permanent; + rewrite ^/en/learn/case-studies/keith$ https://www.canada.ca/en/services/retirement/learn/case-studies-keith.html permanent; + rewrite ^/en/checklist/$ https://www.canada.ca/en/services/retirement/quiz-main.html permanent; + rewrite ^/fr/home$ https://www.canada.ca/fr/services/retraite.html permanent; + rewrite ^/fr/learn$ https://www.canada.ca/fr/services/retraite/apprendre.html permanent; + rewrite ^/fr/quiz$ https://www.canada.ca/fr/services/retraite/questionnaire-principal.html permanent; + rewrite ^/fr/learn/deciding-when-to-start-your-public-pensions$ https://www.canada.ca/fr/services/retraite/apprendre/decider-quand-recevoir-sa-pension-publique.html permanent; + rewrite ^/fr/learn/rules-of-thumb-for-public-pensions$ https://www.canada.ca/fr/services/retraite/apprendre/regles-generales-pensions-publiques.html permanent; + rewrite ^/fr/learn/main-sources-of-retirement-income$ https://www.canada.ca/fr/services/retraite/apprendre/principales-sources-revenus-retraite.html permanent; + rewrite ^/fr/learn/going-from-work-to-retirement$ https://www.canada.ca/fr/services/retraite/apprendre/transition-travail-retraite.html permanent; + rewrite ^/fr/learn/planning-to-save-for-retirement$ https://www.canada.ca/fr/services/retraite/apprendre/planifier-epargner-retraite.html permanent; + rewrite ^/fr/learn/case-studies/bonnie$ https://www.canada.ca/fr/services/retraite/apprendre/etudes-cas-bonnie.html permanent; + rewrite ^/fr/learn/case-studies/fred$ https://www.canada.ca/fr/services/retraite/apprendre/etudes-cas-fred.html permanent; + rewrite ^/fr/learn/case-studies/keith$ https://www.canada.ca/fr/services/retraite/apprendre/etudes-cas-keith.html permanent; + rewrite ^/fr/checklist/$ https://www.canada.ca/fr/services/retraite/questionnaire-principal.html permanent; + rewrite ^/en$ https://www.canada.ca/en/services/retirement.html permanent; + rewrite ^/fr$ https://www.canada.ca/fr/services/retraite.html permanent; + rewrite ^/$ https://www.canada.ca/fr/services/retraite.html permanent; labels: app.kubernetes.io/name: seniors-journey-frontend spec: diff --git a/gitops/environments/staging/ingresses.yaml b/gitops/environments/staging/ingresses.yaml index 3f5d81a7..63d37593 100644 --- a/gitops/environments/staging/ingresses.yaml +++ b/gitops/environments/staging/ingresses.yaml @@ -5,6 +5,34 @@ metadata: annotations: nginx.ingress.kubernetes.io/proxy-buffer-size: 32k # required for OAuth proxy nginx.ingress.kubernetes.io/ssl-redirect: 'true' + nginx.ingress.kubernetes.io/server-snippet: | + rewrite ^/en/home$ https://www.canada.ca/en/services/retirement.html permanent; + rewrite ^/en/learn$ https://www.canada.ca/en/services/retirement/learn.html permanent; + rewrite ^/en/quiz$ https://www.canada.ca/en/services/retirement/quiz-main.html permanent; + rewrite ^/en/learn/deciding-when-to-start-your-public-pensions$ https://www.canada.ca/en/services/retirement/learn/deciding-when-start-your-public-pensions.html permanent; + rewrite ^/en/learn/rules-of-thumb-for-public-pensions$ https://www.canada.ca/en/services/retirement/learn/rules-thumb-public-pensions.html permanent; + rewrite ^/en/learn/main-sources-of-retirement-income$ https://www.canada.ca/en/services/retirement/learn/main-sources-retirement-income.html permanent; + rewrite ^/en/learn/going-from-work-to-retirement$ https://www.canada.ca/en/services/retirement/learn/going-work-retirement.html permanent; + rewrite ^/en/learn/planning-to-save-for-retirement$ https://www.canada.ca/en/services/retirement/learn/planning-save-retirement.html permanent; + rewrite ^/en/learn/case-studies/bonnie$ https://www.canada.ca/en/services/retirement/learn/case-studies-bonnie.html permanent; + rewrite ^/en/learn/case-studies/fred$ https://www.canada.ca/en/services/retirement/learn/case-studies-fred.html permanent; + rewrite ^/en/learn/case-studies/keith$ https://www.canada.ca/en/services/retirement/learn/case-studies-keith.html permanent; + rewrite ^/en/checklist/$ https://www.canada.ca/en/services/retirement/quiz-main.html permanent; + rewrite ^/fr/home$ https://www.canada.ca/fr/services/retraite.html permanent; + rewrite ^/fr/learn$ https://www.canada.ca/fr/services/retraite/apprendre.html permanent; + rewrite ^/fr/quiz$ https://www.canada.ca/fr/services/retraite/questionnaire-principal.html permanent; + rewrite ^/fr/learn/deciding-when-to-start-your-public-pensions$ https://www.canada.ca/fr/services/retraite/apprendre/decider-quand-recevoir-sa-pension-publique.html permanent; + rewrite ^/fr/learn/rules-of-thumb-for-public-pensions$ https://www.canada.ca/fr/services/retraite/apprendre/regles-generales-pensions-publiques.html permanent; + rewrite ^/fr/learn/main-sources-of-retirement-income$ https://www.canada.ca/fr/services/retraite/apprendre/principales-sources-revenus-retraite.html permanent; + rewrite ^/fr/learn/going-from-work-to-retirement$ https://www.canada.ca/fr/services/retraite/apprendre/transition-travail-retraite.html permanent; + rewrite ^/fr/learn/planning-to-save-for-retirement$ https://www.canada.ca/fr/services/retraite/apprendre/planifier-epargner-retraite.html permanent; + rewrite ^/fr/learn/case-studies/bonnie$ https://www.canada.ca/fr/services/retraite/apprendre/etudes-cas-bonnie.html permanent; + rewrite ^/fr/learn/case-studies/fred$ https://www.canada.ca/fr/services/retraite/apprendre/etudes-cas-fred.html permanent; + rewrite ^/fr/learn/case-studies/keith$ https://www.canada.ca/fr/services/retraite/apprendre/etudes-cas-keith.html permanent; + rewrite ^/fr/checklist/$ https://www.canada.ca/fr/services/retraite/questionnaire-principal.html permanent; + rewrite ^/en$ https://www.canada.ca/en/services/retirement.html permanent; + rewrite ^/fr$ https://www.canada.ca/fr/services/retraite.html permanent; + rewrite ^/$ https://www.canada.ca/fr/services/retraite.html permanent; labels: app.kubernetes.io/name: seniors-journey-frontend spec: diff --git a/gitops/environments/test/ingresses.yaml b/gitops/environments/test/ingresses.yaml index c33b63be..742a8b83 100644 --- a/gitops/environments/test/ingresses.yaml +++ b/gitops/environments/test/ingresses.yaml @@ -20,3 +20,57 @@ spec: name: seniors-journey-frontend port: name: http + +--- +apiVersion: networking.k8s.io/v1 +kind: Ingress +metadata: + name: seniors-journey-frontend + annotations: + nginx.ingress.kubernetes.io/proxy-buffer-size: 32k # required for OAuth proxy + nginx.ingress.kubernetes.io/ssl-redirect: 'true' + nginx.ingress.kubernetes.io/server-snippet: | + rewrite ^/en/home$ https://www.canada.ca/en/services/retirement.html permanent; + rewrite ^/en/learn$ https://www.canada.ca/en/services/retirement/learn.html permanent; + rewrite ^/en/quiz$ https://www.canada.ca/en/services/retirement/quiz-main.html permanent; + rewrite ^/en/learn/deciding-when-to-start-your-public-pensions$ https://www.canada.ca/en/services/retirement/learn/deciding-when-start-your-public-pensions.html permanent; + rewrite ^/en/learn/rules-of-thumb-for-public-pensions$ https://www.canada.ca/en/services/retirement/learn/rules-thumb-public-pensions.html permanent; + rewrite ^/en/learn/main-sources-of-retirement-income$ https://www.canada.ca/en/services/retirement/learn/main-sources-retirement-income.html permanent; + rewrite ^/en/learn/going-from-work-to-retirement$ https://www.canada.ca/en/services/retirement/learn/going-work-retirement.html permanent; + rewrite ^/en/learn/planning-to-save-for-retirement$ https://www.canada.ca/en/services/retirement/learn/planning-save-retirement.html permanent; + rewrite ^/en/learn/case-studies/bonnie$ https://www.canada.ca/en/services/retirement/learn/case-studies-bonnie.html permanent; + rewrite ^/en/learn/case-studies/fred$ https://www.canada.ca/en/services/retirement/learn/case-studies-fred.html permanent; + rewrite ^/en/learn/case-studies/keith$ https://www.canada.ca/en/services/retirement/learn/case-studies-keith.html permanent; + rewrite ^/en/checklist/$ https://www.canada.ca/en/services/retirement/quiz-main.html permanent; + rewrite ^/fr/home$ https://www.canada.ca/fr/services/retraite.html permanent; + rewrite ^/fr/learn$ https://www.canada.ca/fr/services/retraite/apprendre.html permanent; + rewrite ^/fr/quiz$ https://www.canada.ca/fr/services/retraite/questionnaire-principal.html permanent; + rewrite ^/fr/learn/deciding-when-to-start-your-public-pensions$ https://www.canada.ca/fr/services/retraite/apprendre/decider-quand-recevoir-sa-pension-publique.html permanent; + rewrite ^/fr/learn/rules-of-thumb-for-public-pensions$ https://www.canada.ca/fr/services/retraite/apprendre/regles-generales-pensions-publiques.html permanent; + rewrite ^/fr/learn/main-sources-of-retirement-income$ https://www.canada.ca/fr/services/retraite/apprendre/principales-sources-revenus-retraite.html permanent; + rewrite ^/fr/learn/going-from-work-to-retirement$ https://www.canada.ca/fr/services/retraite/apprendre/transition-travail-retraite.html permanent; + rewrite ^/fr/learn/planning-to-save-for-retirement$ https://www.canada.ca/fr/services/retraite/apprendre/planifier-epargner-retraite.html permanent; + rewrite ^/fr/learn/case-studies/bonnie$ https://www.canada.ca/fr/services/retraite/apprendre/etudes-cas-bonnie.html permanent; + rewrite ^/fr/learn/case-studies/fred$ https://www.canada.ca/fr/services/retraite/apprendre/etudes-cas-fred.html permanent; + rewrite ^/fr/learn/case-studies/keith$ https://www.canada.ca/fr/services/retraite/apprendre/etudes-cas-keith.html permanent; + rewrite ^/fr/checklist/$ https://www.canada.ca/fr/services/retraite/questionnaire-principal.html permanent; + rewrite ^/en$ https://www.canada.ca/en/services/retirement.html permanent; + rewrite ^/fr$ https://www.canada.ca/fr/services/retraite.html permanent; + rewrite ^/$ https://www.canada.ca/fr/services/retraite.html permanent; + labels: + app.kubernetes.io/name: seniors-journey-frontend +spec: + ingressClassName: nginx + rules: + - host: seniors-journey-test.dev-dp.dts-stn.com + http: + paths: + - path: / + pathType: Prefix + backend: + service: + name: seniors-journey-frontend + port: + name: http + +