Chinaunix首页 | 论坛 | 博客
  • 博客访问: 2148296
  • 博文数量: 317
  • 博客积分: 5670
  • 博客等级: 大校
  • 技术积分: 3677
  • 用 户 组: 普通用户
  • 注册时间: 2008-08-10 17:51
文章分类

全部博文(317)

文章存档

2016年(2)

2015年(44)

2014年(68)

2013年(42)

2012年(23)

2011年(51)

2010年(67)

2009年(17)

2008年(3)

分类: LINUX

2015-03-24 15:22:01

nginx下,可以和缓存时间一起设置
log_format  access  '$remote_addr - $remote_user [$time_local] "$request" '
              '$status $body_bytes_sent "$http_referer" '
              '"$http_user_agent" $http_x_forwarded_for';

   location ~ .*\.(gif|jpg|jpeg|png|bmp|swf)$
    {
        expires      30d;
        access_log off;
    }

    location ~ .*\.(js|css)?$
    {
        expires      1d;
        access_log off;
    }
    access_log  /www/logs/9enjoy.com.log access;

apache下两种方式:
1.只记录html,htm,php等文件
SetEnvIfNoCase Request_URI "(\.htm|\/|\.html|\.php)$" htm
CustomLog logs/9enjoy.com-access_log combined env=htm

2.排除法:

SetEnv IMAGE 1

CustomLog logs/9enjoy.com-access_log combined env=!IMAGE
阅读(1098) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~