Skip to content

Instantly share code, notes, and snippets.

@pdeschen
Created January 16, 2011 19:09
Show Gist options
  • Save pdeschen/782045 to your computer and use it in GitHub Desktop.
Save pdeschen/782045 to your computer and use it in GitHub Desktop.
Base proxy and caching config for nginx.conf
http {
...
#caching related
client_body_temp_path /var/lib/nginx/body 1 2;
gzip_buffers 32 8k;
gzip on;
tcp_nodelay on;
gzip_types
text/html
application/javascript
text/javascript
text/css
text/xml
application/atom+xml
application/xml;
proxy_cache_path /var/lib/nginx/cache levels=1:2
keys_zone=staticfilecache:180m max_size=500m;
proxy_temp_path /var/lib/nginx/proxy;
proxy_connect_timeout 30;
proxy_read_timeout 120;
proxy_send_timeout 120;
proxy_cache_key "$scheme://$host$request_uri";
...
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment