Last active
December 17, 2015 13:29
-
-
Save iambibhas/5617682 to your computer and use it in GitHub Desktop.
Nginx configs to read about later for static files
This file contains hidden or 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
# 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