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

255
Views
Enable rewrite for a particular host in ingress nginx configuration

I have below ingress-nginx configuration file.

It rewrites request for one.example.com. I have added another domain, but I don't want rewrite to happen for other domain.

I went through doc, but there is now rewrite example for multiple host setup.

apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
  name: ingress-service
  annotations:
    kubernetes.io/ingress.class: nginx
    nginx.ingress.kubernetes.io/use-regex: "true"
    nginx.ingress.kubernetes.io/rewrite-target: /$1
    certmanager.k8s.io/cluster-issuer: "letsencrypt-example-prod"
    nginx.ingress.kubernetes.io/ssl-redirect: "true"
spec:
  tls:
    - hosts:
        - one.example.com
        - two.example.com
      secretName: super-secret
  rules:
    - host: one.example.com
      http:
        paths:
          - path: /customer/?(.*)
            pathType: Prefix
            backend:
              service:
                name: customer-srv
                port:
                  number: 3000
      host: two.example.com
      http:
        paths:
        - path: /
          pathType: Prefix
          backend:
            service:
              name: kube-prometheus-grafana
              port:
                number: 80

I could create two separate ingress files for each host.

What will happen in that case it will create two load balancers with different dns?

(cluster is hosted on aws)

over 4 years ago · Santiago Trujillo
1 answers
Answer question

0

You can create two separate ingress.

In that case, nothing will change your ingress controller IP would be same only for DNS.

What will happen in that case it will create two load balancers with different dns?

No, it won't create two load balancers.

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!