From e2ac6046de4d42d5220b1514b49e401ceb081b78 Mon Sep 17 00:00:00 2001 From: Vincent BRIDIER Date: Wed, 26 Feb 2025 15:31:21 +0100 Subject: [PATCH] feat: Add .net redirect Close #219 --- production-resources.yaml | 48 ++++++++++++++++++++++++++++++++++++--- 1 file changed, 45 insertions(+), 3 deletions(-) diff --git a/production-resources.yaml b/production-resources.yaml index 7ae454b..db3f496 100644 --- a/production-resources.yaml +++ b/production-resources.yaml @@ -5,9 +5,51 @@ metadata: name: $APP_DOMAIN spec: dnsNames: - - $APP_DOMAIN - - www.${APP_DOMAIN} + - $APP_DOMAIN + - www.${APP_DOMAIN} secretName: $APP_DOMAIN issuerRef: name: $APP_CERT_ISSUER - kind: ClusterIssuer \ No newline at end of file + kind: ClusterIssuer +--- +# Redirect with domain replacement +apiVersion: traefik.io/v1alpha1 +kind: Middleware +metadata: + name: redirect-lglpronet-to-lglprofr +spec: + redirectRegex: + regex: ^https://(.*)legauloisprofessionnel.net/(.*) + replacement: https://${REDIRECT}${APP_DOMAIN} + permanent: true +--- +apiVersion: traefik.io/v1alpha1 +kind: IngressRoute +metadata: + name: redirect-lglpronet-to-lglprofr +spec: + entryPoints: + - websecure + routes: + - match: Host(`legauloisprofessionnel.net`) || Host(`www.legauloisprofessionnel.net`) + kind: Rule + services: + - name: api@internal + kind: TraefikService + middlewares: + - name: redirect-lglpronet-to-lglprofr + tls: + secretName: legauloisprofessionnel.net +--- +apiVersion: cert-manager.io/v1 +kind: Certificate +metadata: + name: legauloisprofessionnel.net +spec: + dnsNames: + - legauloisprofessionnel.net + - www.legauloisprofessionnel.net + secretName: legauloisprofessionnel.net + issuerRef: + name: $APP_CERT_ISSUER + kind: ClusterIssuer