Camunda page is not loading with K8s nginx rewrite annotation

Hi,
I have camunda spring boot application deployed as K8s deployment and have 2 replicas running. To enable session affinity, have configured K8s nginx. i am using rewrite annotation to to differentiate multiple microservices running. Below is my ingress resource definition and the url that am using to access the camunda page - http://:/sample/camunda/app/welcome/default/

    apiVersion: extensions/v1beta1
    kind: Ingress
   metadata:
   name: myservice
  annotations:
     nginx.ingress.kubernetes.io/affinity: "cookie"
     nginx.ingress.kubernetes.io/session-cookie-name: "sample"
     nginx.ingress.kubernetes.io/session-cookie-expires: "172800"
     nginx.ingress.kubernetes.io/session-cookie-max-age: "172800"
     nginx.ingress.kubernetes.io/use-port-in-redirects: "false"
     nginx.ingress.kubernetes.io/rewrite-target: /camunda/app/welcome/default/
    spec:
     rules:
    - http:
       paths:
       - backend:
           serviceName: myservice-service
           servicePort: 61055
         path: /sample

if I dont use rewrite annotation and use the below definition , it works fine with the url - http://:/camunda/app/welcome/default/

       apiVersion: extensions/v1beta1
       kind: Ingress
      metadata:
         name: myservice
         annotations:
           nginx.ingress.kubernetes.io/affinity: "cookie"
           nginx.ingress.kubernetes.io/session-cookie-name: "sample"
           nginx.ingress.kubernetes.io/session-cookie-expires: "172800"
           nginx.ingress.kubernetes.io/session-cookie-max-age: "172800"
           nginx.ingress.kubernetes.io/use-port-in-redirects: "false"    
       spec:
         rules:
         - http:
           paths:
            - backend:
              serviceName: myservice-service
              servicePort: 61055
             path: /

As I need to use different paths for different services, I had to go for rewrite annotation. But the camunda page is not loading if I use rewrite rule. Could you please suggest a solution?

You need to the change the base URL by using Camunda 7.13 feature . As a few microservices will be deployed in the k8s and the ask to access the microservice(camunda cockpit) using the context path . To do that you need to inject below parameter .
-Dcamunda.bpm.webapp.application-path=/