Created
January 30, 2021 22:34
-
-
Save mkdizajn/506eab5938fdffdc77ab3473de9d8918 to your computer and use it in GitHub Desktop.
nginx cache
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 | |
set $condition ''; | |
if ($request_method = POST){ | |
set $condition "null"; | |
} | |
if ($query_string) { | |
set $condition "null"; | |
} | |
if ($http_cookie ~* (comment_author|comment_author_|wordpress_logged_in|wp_woocommerce_session)) { | |
set $condition "null"; | |
} | |
set $fullurl '/wp-content/cache/all${condition}'; | |
#CACHE ENDING | |
location / { | |
set $serve_URL $fullurl${uri}index.html; | |
add_header mk-cache-loc $serve_URL; | |
try_files $serve_URL $uri $uri/ /index.php$is_args$args; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment