Disable caching of a single file with try_files directive

后端 未结 6 778
情书的邮戳
情书的邮戳 2021-02-01 16:42

I\'m serving Angular 2 application with nginx using location section this way:

location / {
  try_files $uri $uri/ /index.html =404;
}

try_file

6条回答
  •  野性不改
    2021-02-01 17:14

    Just to be safe :)

    location = /index.html {
        add_header 'Cache-Control' 'no-store, no-cache, must-revalidate, proxy-revalidate, max-age=0';
        expires off;
    }        
    

提交回复
热议问题