在nginx上select.jscaching

我有一个.js文件,不能被浏览器caching。 由于这个文件,我在我的nginxconfiguration文件中有这个:

location ~* .(js)$ { expires epoch; log_not_found off; access_log off; } 

然而,这太可怕了:因为一个文件,所有其他的.js文件不会被浏览器caching。 子域中有可能被caching的.js文件。 所以,我可以这样做:

•不允许我的主公用文件夹上的所有.js文件被caching,并让所有在子文件夹上的文件都被caching。

我怎样才能在nginx中进行configuration?

谢谢。

 location = /dont/cache/this.js { expires epoch; } location ~* \.js$ { expires max; }