Skip to content

Instantly share code, notes, and snippets.

@iambibhas
Last active December 17, 2015 13:29
Show Gist options
  • Save iambibhas/5617682 to your computer and use it in GitHub Desktop.
Save iambibhas/5617682 to your computer and use it in GitHub Desktop.
Nginx configs to read about later for static files
# This block will catch static file requests, such as images, css, js
# The ?: prefix is a 'non-capturing' mark, meaning we do not require
# the pattern to be captured into $1 which should help improve performance
location ~* \.(?:ico|css|js|gif|jpe?g|png)$ {
# Some basic cache-control for static files to be sent to the browser
expires max;
# Does the same as Cache-Control: public
add_header Pragma public;
# what are the latter two? o_O
add_header Cache-Control "public, must-revalidate, proxy-revalidate";
# what is this?
add_header Vary Accept-Encoding;
access_log off;
}
# Must do these
location = /robots.txt { access_log off; log_not_found off; }
location = /favicon.ico { access_log off; log_not_found off; }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment