Is it possible to set ingress path to return a 4xx code?

Currently we have something like this:

  - backend:
      serviceName: service1
      servicePort: 80
    path: /path1
  - backend:
      serviceName: service2
      servicePort: 80
    path: /path2
  - backend:
      serviceName: service3
      servicePort: 80
    path: /path3

which will allow users for example to hit /path1/anything after the /path1/****.
I have some specific routes that i want restricted or rerouted.
example, i want users when /path1/helloexample/healthcheck to be restricted and return a 404 or 403 code but still allow anything else in /path1

edit: I did successfully get middleware redirect regex working but it redirects to a different uri or page. I want a return status only. Any help?

thank you in advance

Hi @taro
Were you able to solve this (apart from workaround)? I too have the same requirement and currently using v2.6