Skip to content

Instantly share code, notes, and snippets.

@cavearr
Forked from johndwells/cachebust.conf
Created April 28, 2021 13:53
Show Gist options
  • Save cavearr/553c40bc454d17c46ba615a4b7e8373f to your computer and use it in GitHub Desktop.
Save cavearr/553c40bc454d17c46ba615a4b7e8373f 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