<p>I have this ingress and service created on my Kubernetes cluster</p>
<pre class="lang-yaml prettyprint-override"><code>apiVersion: v1
metadata:
  name: google-storage-buckets
spec:
  type: ExternalName
  externalName: storage.googleapis.com
---
apiVersion: extensions/v1beta1
kind: Ingress
metadata:
  name: proxy-assets-ingress
  annotations:
    kubernetes.io/ingress.class: nginx
    nginx.ingress.kubernetes.io/rewrite-target: /kinto-static-websites/gatsby/public/$1
    nginx.ingress.kubernetes.io/upstream-vhost: &quot;storage.googleapis.com&quot;
    nginx.ingress.kubernetes.io/backend-protocol: &quot;HTTPS&quot;
spec:
  rules:
  - host: gatsby.vegeta.kintohub.net
    http:
      paths:
      - path: /(.*)$
        backend:
          serviceName: google-storage-buckets
          servicePort: 443
</code></pre>
<p>However, this works only if I add <code>index.html</code> after gatsby.vegeta.kintohub.net.</p>
<p>Same if I go on gatsby.vegeta.kintohub.net/page-2.</p>
<p>How could I make this work plz?</p>
<p>Thanks</p>

<p>Here it's more about your <code>nginx.conf</code> and what it thinks it's a default file to try 👀.</p>
<p>The default ingress configuration doesn't have such as thing as always try <code>index.html</code>, so you need to add some extra configuration to your <a href="https://kubernetes.io/docs/concepts/services-networking/ingress/" rel="nofollow noreferrer"><code>Ingress</code></a> Kubernetes resource. In the case of the nginx ingress controller, you can use the <a href="https://kubernetes.github.io/ingress-nginx/user-guide/nginx-configuration/annotations/#configuration-snippet" rel="nofollow noreferrer"><code>configuration-snippet</code></a> annotation which will add a config under the <code>location</code> directive. Something like this should do:</p>
<pre><code>nginx.ingress.kubernetes.io/configuration-snippet: |
      try_files $uri $uri/ $uri/index.html /index.html; 

</code></pre>
<p>✌️</p>
