Location directives doesn’t match query string, you have to
use “if” to check for “v” argument.
Something like this should work:
location ~* \.(js|css)$ {
if ($arg_v) {
expires 1y;
}
# no expires for requests without v= argument
}
Note that generally “if” is evil (search mailing list archive for
details) and it’s use is discouraged. In this particular case
it should be safe enough, but expanding the above configuration
may introduce problems.
Maxim D.
This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.