Nginx,closurescaching为一个特定的文件

location /static { alias /home/ubuntu/Documents/zibann/momsite/momsite/static; # your Django project's static files - amend as required if ($uri ~* ".*config.js") { expires off; } if ($uri ~* ".*\.(js|css|png|jpg|jpeg|gif|swf|svg)" ) { access_log off; expires 365d; add_header Cache-Control public; } } 

希望config.js不会被caching,但它确实。
如何从caching中排除一个文件?

为config.js创建一个单独的位置块,使其位于其他位置之上。

 location ~ config\.js { alias xyz; expires off; } location static etc