Skip to content

Instantly share code, notes, and snippets.

@mxcoder
Created January 23, 2014 22:31
Show Gist options
  • Save mxcoder/8588153 to your computer and use it in GitHub Desktop.
Save mxcoder/8588153 to your computer and use it in GitHub Desktop.
Nginx common configuration
## Images and static content is treated different
location ~* \.(jpg|jpeg|gif|css|png|js|ico|xml|swf|eot|woff|ttf)$ {
access_log off;
expires 30d;
}
## Cache policy for webfonts
location ~* \.(eot|ttf|woff)$ {
add_header Access-Control-Allow-Origin *;
}
## Disable viewing hidden files
location ~* \.(htaccess|htpasswd|git|conf|log|sh) {
deny all;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment