<p>I have an ingress definition in Kubernetes. </p>

<pre><code>apiVersion: extensions/v1beta1
kind: Ingress
metadata:
  name: dev
  annotations:
    kubernetes.io/ingress.class: nginx
    #nginx.ingress.kubernetes.io/use-regex: "true"

    nginx.ingress.kubernetes.io/rewrite-target: /


spec:
  tls:
  - hosts:
    - xyz.org
    secretName: ingress-tls
  rules:
  - host: xyz.org
    http:
      paths:
      - path: /configuration/*
        backend:
          serviceName: dummysvc
          servicePort: 80           
</code></pre>

<p>I need that whenver I hit url : <a href="https://example.com/configuration/" rel="nofollow noreferrer">https://example.com/configuration/</a> it should go to some file or some entity which the service sends as a response but this does not happen it gives me an error page "No webpage was found for above address"
Is this the issue with ingress??</p>

<p>Below is my service spec:</p>

<pre><code>apiVersion: v1
kind: Service
metadata:
  name: dummysvc
spec:
  #type: LoadBalancer
  type: NodePort
  ports:
  - port: 80
    targetPort: 80
    protocol: TCP
  selector:
    app: configurationservice
</code></pre>

<p>Below is my <strong><em>deployment spec</em></strong>:</p>

<pre><code>apiVersion: apps/v1
kind: Deployment
metadata:
  name: dummy-deployment
  labels:
    app: configurationservice
spec:
  replicas: 3
  selector:
    matchLabels:
      app: configurationservice
  template:
    metadata:
      labels:
        app: configurationservice
    spec:
      volumes:
        - name: appinsights
          secret:
            secretName: appinsightngm-secrets
        - name: cosmosdb
          secret:
            secretName: cosmosdbngm-secrets
        - name: blobstorage
          secret:
            secretName: blobstoragengm-secrets
        - name: azuresearch
          secret:
            secretName: azuresearchngm-secrets            
      containers:
      - name: configurationservice
        image: xyz.azurecr.io/xyz.configurationservice:develop
        imagePullPolicy: Always
        ports:
        - containerPort: 80
        volumeMounts:
          - name: appinsights
            mountPath: "/appinsights/"
            readOnly: true
          - name: cosmosdb
            mountPath: "/cosmosdb/"
            readOnly: true
          - name: blobstorage
            mountPath: "/blobstorage/"
            readOnly: true
          - name: azuresearch
            mountPath: "/azuresearch/"
            readOnly: true
---
apiVersion: v1
kind: Service
metadata:
  name: dummysvc
spec:
  #type: LoadBalancer
  type: NodePort
  ports:
  - port: 80
    targetPort: 80
    protocol: TCP
  selector:
    app: configurationservice
</code></pre>

<p>You can try this example on:
<a href="https://github.com/kubernetes/ingress-nginx/blob/master/docs/examples/rewrite/README.md#rewrite-target" rel="nofollow noreferrer">https://github.com/kubernetes/ingress-nginx/blob/master/docs/examples/rewrite/README.md#rewrite-target</a></p>

<pre><code>$ echo "
apiVersion: extensions/v1beta1
kind: Ingress
metadata:
  annotations:
    nginx.ingress.kubernetes.io/rewrite-target: /$1
  name: rewrite
  namespace: default
spec:
  rules:
  - host: rewrite.bar.com
    http:
      paths:
      - backend:
          serviceName: http-svc
          servicePort: 80
        path: /something/?(.*)
" | kubectl create -f -
</code></pre>
