Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

216
Views
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 answers
Answer question

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 Report

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 Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!