分享、学习、提高
2010/01/19 21:01
文章作者:Enjoy 转载请注明原文链接。
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.排除法:
<FilesMatch “\.(ico|gif|jpg|png|bmp|swf|js|css)”>
SetEnv IMAGE 1
</FilesMatch>
CustomLog logs/9enjoy.com-access_log combined env=!IMAGE

发表评论
表情
emotemotemotemotemot
打开HTML
打开UBB
打开表情
隐藏
昵称   密码   游客无需密码
网址   电邮   [注册]