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