Created
April 2, 2015 02:45
-
-
Save zeroasterisk/59744c8035032752790a to your computer and use it in GitHub Desktop.
nginx config for client asset optimizations
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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