apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
  name: myapp-ingress
  annotations:
    kubernetes.io/ingress.class: nginx
    nginx.ingress.kubernetes.io/rewrite-target: /$1
  
spec:
  rules:
    - http:
        paths: 
          - path: /api/(.*)
            pathType: Prefix
            backend: 
              service:
                name: newbackend-clusterip
                port:
                  number: 5000
          - path: /(.*)
            pathType: Prefix
            backend: 
              service:
                name: my-nginx-clusterip
                port:
                  number: 80