服务器:阿里云,lnmp1.4版本(centos7+nginx+mysql+php)
最近用ftp更新网站静态文件,发现用新图片覆盖旧图片后,前台依然显示旧图片,然后删除服务器上的图片,前台依然会显示。
清理了网站缓存和本地浏览器缓存还是会显示,不同框架的网站都是同样的问题
请问可能是什么原因
虚拟机配置文件:
server
{
listen 80;
#listen [::]:80;
server_name www.domain.com domain.com;
index index.html index.htm index.php default.html default.htm default.php;
root /home/wwwroot/www.domain.com;
include www.domain.com.conf;
#error_page 404 /404.html;
location ~ [^/]\.php(/|$)
{
# comment try_files $uri =404; to enable pathinfo
try_files $uri =404;
fastcgi_pass unix:/tmp/php-cgi.sock;
fastcgi_index index.php;
include fastcgi.conf;
#include pathinfo.conf;
}
location ~ .*\.(gif|jpg|jpeg|png|bmp|swf)$
{
expires 30d;
}
location ~ .*\.(js|css)?$
{
expires 12h;
}
access_log /home/wwwlogs/www.domain.com.log access;
}
我将30d改成0d,或者直接删除location ~,然后重启nginx,还是不行
最终原因:
因为网站之前使用了百度云加速,虽然本地删除了图片,但在百度CDN上面还有,所以打开网页上面显示的是百度CDN分发的图片。
解决办法:停用百度云加速,就可以了,