Skip to content

Instantly share code, notes, and snippets.

@fay
Created September 23, 2012 03:09
Show Gist options
  • Save fay/3768676 to your computer and use it in GitHub Desktop.
Save fay/3768676 to your computer and use it in GitHub Desktop.
nginx cache file
location / {
proxy_temp_path /home/user/www/static_cache/;
root /home/user/www/static_cache/;
proxy_store on;
proxy_store_access user:rw group:rw all:r;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header Host "static.afaker.com";
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
if ( !-e $request_filename) {
proxy_pass http://afaker.com;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment