Ingress Redirect Issue for Prometheus and Grafana Services in Kubernetes

Hi team,
I would appreciate it if someone could help me resolve my issue. I have been stuck for 2 days, let me explain.
I am trying to expose my Prometheus and Grafana services via an Ingress with the NGINX controller on a local Kubernetes cluster, but I am experiencing an issue with redirection to the authentication pages.

Problem Summary

Redirection and 404 Error:
Grafana: The application expects /login but receives /grafana/login, resulting in a 404 error.
Prometheus: The application expects /graph but receives /prometheus/graph, resulting in a 404 error.

Behavior with Single Path Configuration:
When a single Ingress configuration is used with the path / (e.g., for Grafana), access works correctly,

@mouloud_brahimi I get the same error, it redirect me to login page but with 404.

if I change manually the url to /grafana/login it show me that I use sub-path.

did you find solution for the error?