apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
  name: error-pages
  annotations:
    nginx.ingress.kubernetes.io/rewrite-target: /$2
    nginx.ingress.kubernetes.io/use-regex: "true"
spec:
  ingressClassName: wac-hospital
  rules:
  - http:
      paths:
      - path: /errors(/|$)(.*)
        pathType: Prefix
        backend:
          service:
            name: error-pages
            port:
              name: http