<p>I'm trying to make a simple example of ingress-nginx on google cloud, but it's not matching the subpaths:</p>

<pre><code>apiVersion: extensions/v1beta1
kind: Ingress
metadata:
  name: test-ingress
  annotations:
    nginx.ingress.kubernetes.io/rewrite-target: /
spec:
  rules:
    - http:
        paths:
        - path: /one
          backend:
            serviceName: test-one-backend
            servicePort: 80
        - path: /two
          backend:
            serviceName: test-two-backend
            servicePort: 80
</code></pre>

<p>When I call, <a href="http://server/one" rel="nofollow noreferrer">http://server/one</a> works, but when I call  <a href="http://server/one/path" rel="nofollow noreferrer">http://server/one/path</a> I get a 404.
I'd tried several things like using regex, but is simply not working</p>

<p>The backends are just, echo servers that reply always on any path.</p>

<p>You need to use a <code>/*</code> at the end of the path:</p>

<pre><code>apiVersion: extensions/v1beta1
kind: Ingress
metadata:
  name: test-ingress
  annotations:
    nginx.ingress.kubernetes.io/rewrite-target: /
spec:
  rules:
    - http:
        paths:
        - path: /one/*
          backend:
            serviceName: test-one-backend
            servicePort: 80
        - path: /two
          backend:
            serviceName: test-two-backend
            servicePort: 80
</code></pre>

<p>It's not really <a href="https://github.com/kubernetes/ingress-nginx/issues/1120" rel="nofollow noreferrer">documented widely as of today</a>, but in essence the <code>path</code> translates to a <a href="https://nginx.org/en/docs/http/ngx_http_core_module.html#location" rel="nofollow noreferrer"><code>location {}</code></a> block in the nginx.conf</p>
