Naren Karanam
Naren Karanam

Reputation: 61

Ingress controller is not routing to root

apiVersion: extensions/v1beta1
kind: Ingress
metadata:
  name: portal-ingress-home
  namespace: portal
  annotations:
    kubernetes.io/ingress.class: nginx
    nginx.ingress.kubernetes.io/ssl-redirect: "false"
    #nginx.ingress.kubernetes.io/rewrite-target: /$2
    ingress.kubernetes.io/whitelist-source-range: "213.#####9/20"
spec:
  tls:
    - hosts:
        - portal
      secretName: portal-tls
  rules:
  - host: portal
  - http:
      paths:
      - path: /
        backend:
         serviceName: customer
         servicePort: 80
      - path: /cust(/|$)(.*)
        backend:
         serviceName: customer
         servicePort: 80     

/ path is not going to backend , where as /cust/ is going to back end. I tried every regex pattern also to make default / go to customre service, not working. I'm sure I'm missing something. Pls help....

Upvotes: 0

Views: 175

Answers (1)

coderanger
coderanger

Reputation: 54191

You put the two bits under rules: in two different list items. Remove the second -.

Upvotes: 2

Related Questions