Quantcast
Channel: Nginx Forum - How to...
Viewing all articles
Browse latest Browse all 4759

Re: try_files and static content with query string (token/version)

$
0
0
Hi all...

Auto-update. I found this:

# http://blog.bripkens.de/2012/03/nginx-cache-busting/

server {
# ...

location ~* ^/static/(\w+)/([^/]+)_\d+\.(js|css|png|jpg|jpeg|gif|ico)$ {
alias /srv/www/static/$1/$2.$3;
add_header Vary Accept-Encoding;
expires max;
}

# ...
}


The problem is that if /srv/www/static/$1/$2.$3 does not exist, I lose the fallback to @apache ...

Any other idea? :?

Thanks for any help.

Viewing all articles
Browse latest Browse all 4759

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>