server {
listen 80;
server_name test.exmaple.cn;
location / {
if ($request_filename ~* .*\.(?:htm|html)$) ## 配置页面不缓存html和htm结尾的文件
{
add_header Cache-Control "private, no-store, no-cache, must-revalidate, proxy-revalidate";
}
root /web/;
index index.html;
try_files $uri $uri/ /index.html =404;
}
}
nginx 配置不缓存html文件
最新推荐文章于 2024-05-29 10:40:20 发布