Skip to content

Instantly share code, notes, and snippets.

@vojd
Created December 19, 2012 00:27
Show Gist options
  • Save vojd/4333377 to your computer and use it in GitHub Desktop.
Save vojd/4333377 to your computer and use it in GitHub Desktop.
proxy_cache_path /var/cache/nginx/sub.example.com levels=1:2 keys_zone=media-cache:8m max_size=100m inactive=600m;
proxy_temp_path /var/cache/nginx/tmp/media;
server {
listen 80;
server_name sub.example.com;
client_max_body_size 20m;
access_log /var/log/nginx/sub.example.com.access.log;
error_log /var/log/nginx/sub.example.com.error.log;
location / {
proxy_pass http://localhost:8888;
proxy_redirect off;
proxy_set_header Host $host;
proxy_cache media-cache;
proxy_cache_valid 200 302 60m;
proxy_cache_valid 404 1m;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment