title: Ingress routing rules to access prometheus server
body: <p>I have deployed prometheus server(2.13.1) on kubernetes(1.17.3), I am able to access it on <code>http://my.prom.com:9090</code></p>
  
  <p>But i want to access it on <code>http://my.prom.com:9090/prometheus</code> so i added following ingress rules but its not 
  working</p>
  
  <p><strong>First Try:</strong></p>
  
  <pre><code>apiVersion: networking.k8s.io/v1beta1
  kind: Ingress
  metadata:
    annotations:
      nginx.ingress.kubernetes.io/app-root: /prometheus
    name: approot
    namespace: default
  spec:
    rules:
    - host: my.prom.com
      http:
        paths:
        - backend:
            serviceName: prometheus-svc
            servicePort: 9090
          path: /
  </code></pre>
  
  <p>This results in 404 error</p>
  
  <p><strong>Second Try:</strong></p>
  
  <pre><code>apiVersion: networking.k8s.io/v1beta1
  kind: Ingress
  metadata:
    annotations:
      nginx.ingress.kubernetes.io/rewrite-target: /$2
    name: rewrite
    namespace: default
  spec:
    rules:
    - host: my.prom.com
      http:
        paths:
        - backend:
            serviceName: prometheus-svc
            servicePort: 9090
          path: /prometheus(/|$)(.*)
  </code></pre>
  
  <p>Now when i access URL <code>http://my.prom.com:9090/prometheus</code> in browser it get changed to <code>http://my.prom.com:9090/graph</code> and show 404 error</p>