Skip to content

Instantly share code, notes, and snippets.

@johndwells
Created August 10, 2019 23:13
Show Gist options
  • Save johndwells/8579def0014d09ca4964e725010a289c to your computer and use it in GitHub Desktop.
Save johndwells/8579def0014d09ca4964e725010a289c to your computer and use it in GitHub Desktop.
NGINX - Cachebust static JS and CSS assets that contain a version segment
# Cachebust static JS and CSS assets that contain a version segment, e.g.
# /css/app.purged.min.v0.1.45.css ==> /css/app.purged.min.css
location ~* (.+)\.v(?:[\d\.]+)\.(js|css)$ {
try_files $uri $1.$2;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment