Skip to content

Instantly share code, notes, and snippets.

@lerouxb
Created October 26, 2010 11:27
Show Gist options
  • Select an option

  • Save lerouxb/646728 to your computer and use it in GitHub Desktop.

Select an option

Save lerouxb/646728 to your computer and use it in GitHub Desktop.
nginx config for caching urls with parameters ?v=xxxxx or ?r=xxxxx
server {
listen 80;
server_name static.ammo.dev;
access_log /var/log/nginx/ammostatic.access.log;
location / {
root /home/leroux/projects/ammo/static;
if ($args ~* "^[rv]=.*$") {
expires max;
break;
}
if ($is_args = "") {
add_header Cache-Control must-revalidate;
break;
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment