nginx automatically adds version numbers to static resource files
To automatically append version numbers to JS and CSS files, add the following code to the nginx site configuration file:
location ~ \.(js|css)$ {
root /XXXXXXXX;
if ($request_uri !~ 123){
rewrite ^(.*)$ $1?v=123 permanent;
}
}
Leave a Reply