资料:
实例:修改静态HTML文件,查看网页返回304 Not Modified,服务器上文件已经做了修改,缓存没有被更新,需要返回200状态码
www.xiangcloud.com.cn/market.html
浏览器端If-Modified-Since 和 服务器端Last-Modified 时间一样 显示304 内容无修改,Response Headers 项Cache-Control:max-age=2592000
在浏览器端 Request Headers 项 Cache-Control:max-age=0
配置nginx 缓存 使用expires:-1不使用缓存
查询配置文件 find / -name nginx.conf
找到静态文件配置(vi命名 i - 修改 - esc - : - wq 回车 )
查询nginx启动文件路径 find / -name nginx
cd /usr/sbin
平滑重启nginx
./nginx -s reload
测试配置文件是否正确
./nginx -t
查看nginx 启动路径和配置文件路径
ps aux | grep nginx