配置缓存过期时间
#语法
Syntax: expires [modified] time;
expires epoch | max | off;
Default: expires off;
Context: http, server, location, if in location
#配置过期时间
[root@web01 ~]# vim /etc/nginx/conf.d/cacha.conf
server {
listen 80;
server_name linux.cache.com;
root /code/cache;
location ~* \.(jpg|png|gif)$ {
root /code/cache;
expires 7d; #7天
}
}
本文来自博客园,作者:六月OvO,转载请注明原文链接:https://www.cnblogs.com/chenlifan/p/13651976.html

浙公网安备 33010602011771号