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

225
Visualizações
Access different react paths with root in ingress

I have two react apps, one is for administrators and the other is for normal users. Both have root / access. To enable the admin to access their page while normal user their respective pages, I added a redirect route in react router of admin, it redirects from admin to /. I then added the two backends in my ingress a follows:

apiVersion: networking.k8s.io/v1beta1
kind: Ingress
metadata:
  name: my-ingress
  annotations:
    kubernetes.io/ingress.class: nginx
    # nginx.ingress.kubernetes.io/use-regex: "true"
    # nginx.ingress.kubernetes.io/rewrite-target: /
spec:
  rules:
     paths:
      - path: /
        pathType: Prefix
          backend:
            serviceName: user-service
            servicePort: 3000

      - path: /admin
        pathType: Exact
          backend:
            serviceName: admin-service
            servicePort: 4000

The thing is this, it does not load the admin page. I don't know why... Is there a way to load this different apps with same root paths? (both root paths is /)

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

0

In your admin service please make sure that you are serving from the relative path (here /admin).

In CRA you can do it by configuring the homepage in package.json

 "homepage": "http://example.com/admin",

Refer: https://create-react-app.dev/docs/deployment/#building-for-relative-paths

over 4 years ago · Santiago Trujillo Relatório

0

This this maybe you want - Nginx rewrite

nginx.ingress.kubernetes.io/rewrite-target

This is the full doc. rewrite

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