Skip to content

Instantly share code, notes, and snippets.

@jordangraft
Created February 8, 2017 10:12
Show Gist options
  • Save jordangraft/f88188a4c9e60cc0b9217718e0daf3e7 to your computer and use it in GitHub Desktop.
Save jordangraft/f88188a4c9e60cc0b9217718e0daf3e7 to your computer and use it in GitHub Desktop.
Nginx sites configuration file for pushing caching headers
# in you sites-available files
# gzip all asset requests
location ^~ /assets/ {
gzip_static on;
expires max;
add_header Cache-Control public;
add_header Access-Control-Allow-Origin *;
}
location ~* ^.+\.(jpg|jpeg|gif|png|ico|zip|tgz|gz|rar|bz2|doc|xls|exe|pdf|ppt|txt|tar|mid|midi|wav|bmp|rtf|mp3|flv|mpeg|avi|eof|ttf|woff|woff2)$ {
try_files $uri @door;
expires max;
add_header Cache-Control public;
add_header Access-Control-Allow-Origin *;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment