Last active
September 4, 2016 07:16
-
-
Save stef-k/4f9eed093881720ec4752bb7a8d10072 to your computer and use it in GitHub Desktop.
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
# put this in nginx.conf http block | |
proxy_cache_path /var/cache levels=1:2 keys_zone=nginx_cache:10m max_size=10g inactive=60m | |
use_temp_path=off; | |
# on vhost config put | |
proxy_cache nginx_cache; | |
# 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|woff|ttf|otf|svg|woff2|eot)$ { | |
# Some basic cache-control for static files to be sent to the browser | |
expires 30d; // or use max | |
add_header Pragma public; | |
add_header Cache-Control "public, must-revalidate, proxy-revalidate"; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment