Skip to content

Instantly share code, notes, and snippets.

@mgronhol
Created June 15, 2012 12:14
Show Gist options
  • Save mgronhol/2936176 to your computer and use it in GitHub Desktop.
Save mgronhol/2936176 to your computer and use it in GitHub Desktop.
Nginx fastcgi cachcing
## Taa ensin tonne HTTP tai HTTPS blockin sisalle (esim. virtual.conf tai sitten sites-enables/default tms filuun)
fastcgi_cache_path /var/cache/nginx
levels=1:2 keys_zone=ZONE_KEY_TAHAN:10m
inactive=5m;
fastcgi_cache_key "$scheme$request_method$host$request_uri";
# ja taa sitten locationiin
fastcgi_cache ZONE_KEY_TAHAN;
fastcgi_cache_valid 200 302 1m;
fastcgi_cache_valid 301 1m;
fastcgi_cache_valid any 1m;
fastcgi_cache_min_uses 1;
fastcgi_cache_use_stale error timeout invalid_header http_500;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment