Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

274
Visualizações
Kubernetes Ingress Redirect and Rewrite

quick question as I am sure its an easy fix, just cannot seem to figure it out!

We have a site that runs on www.awesomeapp.com - all working perfectly on ingress routing

However I want to also redirect the route domain to www.awesomeapp.com for example awesomeapp.com => www.awesomeapp.com

I added this annotation nginx.ingress.kubernetes.io/permanent-redirect: https://www.awesomeapp.com

Again all working perfectly.

My question is how do I also get the path added as well. For example

user enters in awesomeapp.com/myawesomepage and what I want is it to not only redirect but append the path as well so it ends up like this

www.blahblah.com/myawesomepage

I added this ingress.kubernetes.io/rewrite-target: /$1$2 but this does not work, and that is in conjunction with this - path: /(/|$)(.*)

Full yaml config as follows:

apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:  
    name: root-routing
    labels:
      app: awesomeapp
    annotations:
        kubernetes.io/ingress.class: nginx     
        nginx.ingress.kubernetes.io/permanent-redirect: https://www.awesomeapp.com
        ingress.kubernetes.io/rewrite-target: /$1$2
spec:
    tls:
    - hosts:
        - awesomeapp.com
      secretName: awesomeapp-com-tlscert
    rules:
    - host: awesomeapp.com
      http:
        paths:
        - path: /(/|$)(.*)
          pathType: Prefix
          backend:
            service:
                name: awesomeapp
                port:
                    number: 80

Thanks John

over 4 years ago · Santiago Trujillo
1 Respostas
Responde à pergunta

0

nginx.ingress.kubernetes.io/server-snippet: | return 301 https://www.awesomeapp.com$request_uri;

over 4 years ago · Santiago Trujillo Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda