Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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