<p>I have a <code>express</code> web server with static files. Let's call this my <code>express-deployment</code>. </p>

<p>I'd like to use my <code>ingress-nginx</code> to serve static files from my <code>express-deployment</code> without ever actually hitting my express server. </p>

<p>In <code>nginx</code> this is done with the <code>location</code> directive where you point to files locally hosted. While I see an option for <code>locations-snippet</code> in the <code>ingress-nginx</code> <code>configMap</code>, I'm not entirely sure how I would have this point to files in another container. </p>

<p>Is this possible with <code>ingress-nginx</code>? If so how would I go about it?  Alternatively, is this something that requires an nginx container to be hosted along side my express server? (Seems odd that I would need 2 nginx for that) </p>

<p>In theory, you could have a PV in in RWX mode mounted to both express and ingress and provide custom config to the nginx-ingress pods, but that should be avoided. Ingress Controller has one responsibility - implement Ingress rules defined in your cluster. To serve static content you should have a pod that does that, which indeed means ie. running second nginx in your stack. The thing is, that you should treat your ingress controller as part of the infrastructure providing generic cluster functionality, and serving static files from some place (or container if they are versioned/built as docker images) is de facto part of your application.</p>
