4

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?

3
  • related: stackoverflow.com/questions/47624902/… Commented May 19, 2021 at 10:52
  • Did you find your solution? Commented Mar 8, 2022 at 11:36
  • @PaulRey, yes basically the solution you've described is the right one, thanks. Commented Mar 9, 2022 at 9:51

1 Answer 1

5

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.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.