How to cache js/css request containing a question mark?

log nginx-forum at nginx.us
Wed Sep 2 06:40:14 UTC 2015


Well, unfortunately this is not working...

http://example.com/style.css?ver=4.3
http://example.com/jquery-migrate.min.js?ver=1.2.1


biazus Wrote:
-------------------------------------------------------
> Please try to remove $ in the end of the expression:
> 
> something like this:
> 
> location ~ .*\.(js|css) {
> expires 7d;
> }
> 
> Also, make sure you are using args in the cache key:
> 
> proxy_cache_key		"$host$uri$is_args$args";
> 
> Regards,
> Biazus

Posted at Nginx Forum: http://forum.nginx.org/read.php?2,261338,261374#msg-261374



More information about the nginx mailing list