nginx 记录特定类型文件的 log

Posted on Posted in nginx

nginx 记录特定类型文件的 log

不记录 log

location ~ .*\.(gif|jpg|jpeg|png|bmp|swf)$ {  # 对(gif|jpg|jpeg|png|bmp|swf)文件访问不记录到日志里面
        access_log off;
}

记录特定类型

location ~ .*\.(mp3|mp4)$ {
   access_log logs/v.access.log main;
   error_log logs/v.error.log;
}

Leave a Reply

Your email address will not be published. Required fields are marked *

7 + 3 =