<p>You can't configure your Ingress to serve static data (from your host files for example) alone because the Ingress resource is just a way to configure a way of understanding for Kubernetes on how to access a specific internal resource from outside the cluster.</p>
<blockquote>
<p>An API object that manages external access to the services in a cluster, typically HTTP.
Ingress may provide load balancing, SSL termination and name-based virtual hosting.
-- Ingress | Kubernetes - <a href="https://kubernetes.io/docs/concepts/services-networking/ingress/" rel="noreferrer">https://kubernetes.io/docs/concepts/services-networking/ingress/</a></p>
</blockquote>
<p>You must configure a web server (NGINX, Apache, etc.) with a mounted volume bound to your files. You'll also need a Service resource to publish the web server access internally. Then the Ingress resource will do the work.</p>

CC BY-SA 4.0
2021-05-17T13:20:07.247Z
2021-05-17T13:20:07.247Z
Paul Rey
<p>I have a simple Django application and on a regular EC2 instance nginx is a reverse proxy serving static files and proxying requests to gunicorn/wsgi backend app.</p>
<p>Should I have a separate deployment and service for nginx which will be able to access static data on a volume to serve it as well as proxy requests to django pods or</p>
<p>Is it possible to configure ingress to serve static data without extra nginx deployment?</p>

CC BY-SA 4.0
2021-05-19T10:52:41.337Z
related: https://stackoverflow.com/questions/47624902/serving-static-files-from-ingress-nginx
Most Wanted
CC BY-SA 4.0
2022-03-08T11:36:38.127Z
Did you find your solution?
Paul Rey
CC BY-SA 4.0
2022-03-09T09:51:08.393Z
@PaulRey, yes basically the solution you've described is the right one, thanks.
Most Wanted
<kubernetes><nginx><ingress><eks><kubernetes-volume>
Kubernetes serve static content with ingress
Most Wanted
# Kubernetes serve static content with ingress

(Asked by: username_0 on 2021-05-17)

I have a simple Django application and on a regular EC2 instance nginx is a reverse proxy serving static files and proxying requests to gunicorn/wsgi backend app.

Should I have a separate deployment and service for nginx which will be able to access static data on a volume to serve it as well as proxy requests to django pods or

Is it possible to configure ingress to serve static data without extra nginx deployment?

**Tags:** kubernetes, nginx, ingress, eks, kubernetes-volume

> **Comments:**
> **username_0**: related: https://stackoverflow.com/questions/47624902/serving-static-files-from-ingress-nginx  
> **username_1**: Did you find your solution?  
> **username_0**: @PaulRey, yes basically the solution you've described is the right one, thanks.  

---

## 1 answers

### Answer by username_1 on 2021-05-17. Score: 5 | Accepted answer

You can't configure your Ingress to serve static data (from your host files for example) alone because the Ingress resource is just a way to configure a way of understanding for Kubernetes on how to access a specific internal resource from outside the cluster.

> An API object that manages external access to the services in a cluster, typically HTTP.
> Ingress may provide load balancing, SSL termination and name-based virtual hosting.
> -- Ingress | Kubernetes - <https://kubernetes.io/docs/concepts/services-networking/ingress/>

You must configure a web server (NGINX, Apache, etc.) with a mounted volume bound to your files. You'll also need a Service resource to publish the web server access internally. Then the Ingress resource will do the work.


---

