nignx开启expires后相关资源不显示的问题
expires可以指定浏览器缓存,加快浏览速度
但是开启expires必须先指定root
server中原来指定
location / {
root D:/WWW;
index index.html index.htm default.html default.htm index.php default.php app.php u.php;
}
include expires.conf;
改为
root D:/WWW;
location / {
index index.html index.htm default.html default.htm index.php default.php app.php u.php;
}
include expires.conf;
即可
另附上expires.conf文件内容
location ~ .*\.(jpg|jpeg|gif|png|bmp|ico|swf)$ {
expires 4h;
access_log off;
}
location ~ .*\.(js|css)$ {
expires 1d;
access_log off;
}
本文来自博客园,作者:Bin_x,转载请注明原文链接:https://www.cnblogs.com/Bin-x/p/5032240.html

浙公网安备 33010602011771号