Skip to content

Instantly share code, notes, and snippets.

@zeroasterisk
Created April 2, 2015 02:45
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save zeroasterisk/59744c8035032752790a to your computer and use it in GitHub Desktop.
Save zeroasterisk/59744c8035032752790a to your computer and use it in GitHub Desktop.
nginx config for client asset optimizations
http {
# Gzip Settings
gzip on;
gzip_disable "msie6";
gzip_buffers 16 8k;
gzip_comp_level 6;
gzip_http_version 1.0;
gzip_min_length 0;
gzip_types text/plain text/css text/javascript text/xml application/xml application/xml+rss application/x-javascript image/x-icon;
server {
location ~* \.(jpg|jpeg|gif|css|png|js|ico|html|swf|eot|svg|ttf|woff|flv|mp3|m4v)$ {
access_log off;
expires max;
#expires 60d;
try_files $uri $uri/ /index.php?url=$request_uri;
if ($args ~ "^download") {
add_header Content-Disposition "attachment; filename=$filename";
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment