将缓存设置添加到我的服务器块后,有些映像不加载,并发送404 not错误
location ~* \.(jpg|jpeg|png|gif|ico|css|js)$ {
expires 365d;
add_header Pragma public;
add_header Cache-Control "public";
}
location ~* \.(pdf)$ {
expires 30d;
}示例
src="/laravel-filemanager/photos/2/path/path-path/my-file.jpg
以及加载的另一个文件的示例。
src="img/main-page.gif“
信息
web服务器: nginx,框架: laravel,laravel文件管理器: unisharp
我不知道问题是关于深度路径,还是因为该路径存储在数据库中,或者可能是因为laravel缓存管理系统。
任何办法或任何方法来检测引擎盖下的东西。
提前感谢
编辑
css和javascript文件正在加载,任何来自mywebsite.com/img的图像,但是来自不同位置的图像都没有加载,我检查了location块,看它是否与所有图像匹配,并且运行良好。
发布于 2019-10-06 17:26:47
将缓存头添加到server块并删除Pragma报头
server {
# other params here
location ~* \.(?:jpg|jpeg|png|gif|ico|css|js)$ {
expires 1y;
access_log off;
add_header Cache-Control "public";
}
}https://stackoverflow.com/questions/58259605
复制相似问题