Answers: <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>
  
Answers: CC BY-SA 4.0
Answers: 2021-05-17T13:20:07.247Z
Answers: 2021-05-17T13:20:07.247Z
Answers: Paul Rey
Body: <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>
  
Comments: CC BY-SA 4.0
Comments: 2021-05-19T10:52:41.337Z
Comments: related: https://stackoverflow.com/questions/47624902/serving-static-files-from-ingress-nginx
Comments: Most Wanted
Comments: CC BY-SA 4.0
Comments: 2022-03-08T11:36:38.127Z
Comments: Did you find your solution?
Comments: Paul Rey
Comments: CC BY-SA 4.0
Comments: 2022-03-09T09:51:08.393Z
Comments: @PaulRey, yes basically the solution you've described is the right one, thanks.
Comments: Most Wanted
Tags: <kubernetes><nginx><ingress><eks><kubernetes-volume>
Title: Kubernetes serve static content with ingress
UserDisplayName: Most Wanted
ThreadText: # 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**: @username_1, 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.
  
  
  ---
  
  