title: Nginx, turn off cache for a specific file
body: <pre><code>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;
      }
  
  }
  </code></pre>
  
  <p>Hoping <code>config.js</code> would not get cached, but it does.<br>
  How can I exclude one file from being cached?</p>