[feat]增加nginx不缓存index.html配置,搭配前端版本自动升级功能使用(不加此配置可能会导致用户刷新后还是旧版本)
This commit is contained in:
@@ -7,6 +7,10 @@ server {
|
||||
index index.html index.htm;
|
||||
root /usr/share/nginx/html;
|
||||
try_files $uri $uri/ /index.html;
|
||||
# 禁止缓存html文件,避免前端页面不及时更新,需要用户手动刷新的情况
|
||||
if ($request_uri ~* "^/$|^/index.html|^/index.htm") {
|
||||
add_header Cache-Control "no-store";
|
||||
}
|
||||
}
|
||||
|
||||
location ~ ^/api/ {
|
||||
|
||||
Reference in New Issue
Block a user