Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

176
Views
Elastic Beanstalk Django Nginx Cache Images

I've deployed an Elastic Beanstalk application and it is using nginx instead of Apache. I would really like to have browser image caching working but I can not find anything online about setting the caching headers with nginx. This was much easier with Apache. Any pointers?

over 4 years ago · Santiago Trujillo
1 answers
Answer question

0

Breaking this into two problems.

  1. Extending AWS Elastic Beanstalk platform configurations for nginx
  2. Configuring nginx

1. Extending AWS Elastic Beanstalk platform configurations for nginx

Within your application deployment to AWS Elastic Beanstalk, you can include an .ebextensions directory containing configuration files, including nginx related .conf files.

For your scenario, that could look like:

~/my-applicaiton/
|-- .ebextensions
|   `-- nginx
|       `-- conf.d
|           `-- image_caching.conf

You'll want to .zip this along with your deployment bundle ensuring the .ebextensions directory is at the root of the .zip.

Resources:

  • https://docs.aws.amazon.com/elasticbeanstalk/latest/dg/ebextensions.html
  • https://docs.aws.amazon.com/elasticbeanstalk/latest/dg/java-se-nginx.html

2. Configuring nginx

Once you've introduced the .ebextensions extension of the existing nginx configuration, you'll be focusing on how nginx can be configured to add the necessary Headers for browser caching to apply to assets.

This other answer may give you more insights on how to configure the location and expiry per asset for nginx.

https://serverfault.com/a/334871

over 4 years ago · Santiago Trujillo Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!