title: How to set no cache on only the index.html page in NGINX
body: <p>My current project is almost working with the following configuration:</p>
  
  <pre><code>root %%COMP_WEB_ROOT;
  
  # COMP Static File serving
  location /comp {
      alias %%COMP_WEB_ROOT;
      try_files $uri$args $uri$args/ /index.html;
      add_header 'Cache-Control' 'no-cache, no-store, must-revalidate';
  }
  
  # Hide the index file, not exposing that path specifically
  location = /index.html {
      internal;
  }
  </code></pre>
  
  <p>With this, I am preventing caching for the entire application, which is not desirable, since I only want to prevent the index.html page from storing cache.</p>
  
  <p>So I have tried to put the <code>add_header</code> line inside the second block like this:</p>
  
  <pre><code>root %%COMP_WEB_ROOT;
  
  # COMP Static File serving
  location /comp {
      alias %%COMP_WEB_ROOT;
      try_files $uri$args $uri$args/ /index.html;
      error_page 401 = @error401web;
  }
  
  # Hide the index file so that we're not exposing that path specifically
  location = /index.html {
      internal;
      add_header 'Cache-Control' 'no-cache, no-store, must-revalidate';
  }
  </code></pre>
  
  <p>NGINX is able to run, but index.html seems to still storing the cache as if the <code>add_header</code> isn't there.</p>
  
  <p>Is there some other command I am missing?  </p>