server {
listen 18080;
server_name localhost;
error_page 500 502 503 504 /50x.html;
location / {
root /Users/huangqingpeng/Desktop/workspaces/qiankun/vue-qiankun-demo/dist;
try_files $uri $uri/ /index.html;
index index.html index.htm;
if ($request_filename ~* .*\.(?:htm|html)$)
{
add_header Cache-Control "private, no-store, no-cache, must-revalidate, proxy-revalidate";
}
if ($request_filename ~* .*\.(?:js|css)$)
{
expires 1d;
}
if ($request_filename ~* .*\.(?:jpg|jpeg|gif|png|ico|cur|gz|svg|svgz|mp4|ogg|ogv|webm)$)
{
expires 1d;
}
}
}
nginx浏览器缓存设置
版权声明:本文为G66565906原创文章,遵循CC 4.0 BY-SA版权协议,转载请附上原文出处链接和本声明。