<p>I use <a href="https://github.com/kubernetes/ingress-nginx/releases/tag/nginx-0.24.1" rel="noreferrer">nginx-ingress-controller:0.24.1</a> (<a href="https://github.com/kubernetes/ingress-nginx/issues/1809" rel="noreferrer">Inspired by</a>)</p>

<p>I would like to set a DNS A record to LB IP address, so it would connect it to the Google cloud public bucket (<code>my-back-end-bucket</code>) that has public index.html in the root AND to the back-end by another url rule.</p>

<pre><code>kind: Service
apiVersion: v1
metadata:
  name: ingress-nginx
  namespace: ingress-nginx
  labels:
    app.kubernetes.io/name: ingress-nginx
    app.kubernetes.io/part-of: ingress-nginx
spec:
  externalTrafficPolicy: Local
  type: LoadBalancer
  selector:
    app.kubernetes.io/name: ingress-nginx
    app.kubernetes.io/part-of: ingress-nginx
  ports:
    - name: http
      port: 80
      targetPort: http
    - name: https
      port: 443
      targetPort: https

---

kind: Service
apiVersion: v1
metadata:
  name: google-storage-buckets-service
  namespace: ingress-nginx
spec:
  type: ExternalName
  externalName: storage.googleapis.com

---
apiVersion: extensions/v1beta1
kind: Ingress
metadata:
  name: proxy-assets-ingress
  namespace: ingress-nginx
  annotations:
    nginx.ingress.kubernetes.io/rewrite-target: /my.bucket.com
    nginx.ingress.kubernetes.io/secure-backends: "true"
    nginx.ingress.kubernetes.io/upstream-vhost: "storage.googleapis.com"
spec:
  rules:
    - http:
        paths:
          - path: /*
            backend:
              serviceName: google-storage-buckets-service
              servicePort: 443
          - path: /c/
            backend:
              serviceName: hello-world-service
              servicePort: 8080
</code></pre>

<p>By reaching <a href="https://my.ip.add.ress/c" rel="noreferrer">https://my.ip.add.ress/c</a> - got both outputs: <strong>Hello, world! bucket content.</strong></p>

<p><strong>"Hello, world!"</strong> form the <strong>hello-world-service</strong></p>

<p><strong>"bucket content"</strong> from the <strong>bucket</strong>' index.html file</p>

<p>Question: how to make it work so, that by <strong>ip/</strong> - I got a bucket content
and by <strong>ip/c</strong> - back-end response content ?</p>

<p>You can split your ingress into two where one defines <code>path: /*</code> with necessary annotation and another ingress that defines <code>path: /c/</code>.</p>

<p>The problem with your single ingress is that its annotations that you want to apply to <code>path: /*</code> only gets applied to other paths as well.</p>
