Home » Code Snippets » Expires headers nginx

Expires headers nginx

location ~* .(eot|otf|woff|woff2|ttf|js|jpg|jpeg|gif|png|bmp|ico|svgz|svg|mid|midi|wav|mp3|ogg|ogv|mp4|swf)$ {
        expires max;
        log_not_found off;
        access_log off;
        add_header Cache-Control "public, no-transform";
}

location ~* .(css|js|rss|atom|zip|tgz|gz|rar|bz2|tar|pdf|doc|rtf|xls|exe|ppt)$ {
        expires 30d;
        log_not_found off;
        access_log off;
}
Share :
Frederic C.

I'm French and born in the '80s. Graduated from a computer license and working as a programmer for more than 10 years. I have not always been good in IT, but by persevering, I gained some experience in this field. Through this website, I share practical and technical tips related to websites and web business.

 October 1, 2019(Updated : October 1, 2019) Frederic C.

Recent Posts
  • Registration of domain name : I recommend Namecheap (my review)
  • Pcloud review : A better cloud storage than Dropbox, iCloud, Google Photos…
  • How to install a WordPress Theme
  • How to post on Instagram from a PC or Mac
  • Website speed tester : How to check if your website is fast?
Creator in Pj's

Creator in Pj's

  • Home
  • About
  • Privacy Policy
  • Terms of Service
© 2025 All rights reserved · creatorpjs.com