Last active
November 13, 2019 08:10
-
-
Save satyadeepk/d3a1d2827cd31b47091a2463ea61ac35 to your computer and use it in GitHub Desktop.
Nginx Proxy Caching
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
#Source: https://stackoverflow.com/a/46266032/559680 | |
# Put these above server block (Don't forget to give write permissions to the cache folder): | |
# proxy_cache_path /opt/nginx/cache levels=1:2 keys_zone=default_cache:10m max_size=100m inactive=5m use_temp_path=off; | |
# proxy_cache_key "$scheme$request_method$host$request_uri"; | |
# proxy_cache_valid 200 302 60m; | |
# To use this in location: | |
# include enable-cache.conf | |
proxy_cache default_cache; | |
add_header X-Proxy-Cache $upstream_cache_status; | |
proxy_buffering on; | |
proxy_ignore_headers Expires; | |
proxy_ignore_headers X-Accel-Expires; | |
proxy_ignore_headers Cache-Control; | |
proxy_ignore_headers Set-Cookie; | |
proxy_hide_header X-Accel-Expires; | |
proxy_hide_header Expires; | |
proxy_hide_header Cache-Control; | |
proxy_hide_header Pragma; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment