Created
July 31, 2017 10:13
-
-
Save admench/98bbc722f7414aabd7dafbd494167ca6 to your computer and use it in GitHub Desktop.
Forge Nginx cache settings
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
# cache.appcache, your document html and data | |
location ~* \.(?:manifest|appcache|html?|xml|json)$ { | |
try_files $uri $uri/ /index.php?$args; | |
expires -1; | |
} | |
# Feed | |
location ~* \.(?:rss|atom)$ { | |
try_files $uri $uri/ /index.php?$args; | |
expires 1h; | |
} | |
location ~* \.(js|css|png|jpg|jpeg|gif|ico|svg|woff)$ { | |
try_files $uri /index.php?$query_string; | |
expires 7d; | |
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
This uses the
try_files
method to work with Craft CMS or similar MVC type url generation. Without this line, the admin panel of Craft will not look correct.