nginx 静态文件不记录日志和过期时间
静态文件不记录日志和过期时间
- /usr/local/nginx/conf/vhost/test01.conf 增加配置如下
location ~ .*\.(gif|jpg|jpeg|png|bmp|swf)$
{
expires 7d; #有效时间
access_log off; #关闭日志
}
location ~ .*\.(js|css)$
{
expires 12h;
access_log off;
}