Skip to content

Instantly share code, notes, and snippets.

@alekseyl
Created January 31, 2017 15:44
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save alekseyl/5cf5f9f4b286188c3d26264c0f4a4335 to your computer and use it in GitHub Desktop.
Save alekseyl/5cf5f9f4b286188c3d26264c0f4a4335 to your computer and use it in GitHub Desktop.
nginx fine cache tuning
proxy_cache_path /path/to/cache levels=1:2 keys_zone=my_cache:10m max_size=10g
inactive=60m use_temp_path=off;
server {
...
location / {
proxy_cache my_cache;
proxy_cache_revalidate on;
proxy_cache_min_uses 1;
proxy_cache_use_stale error timeout updating http_500 http_502 http_503
http_504;
proxy_cache_lock on;
proxy_pass http://my_upstream;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment